Commit Graph

41 Commits

Author SHA1 Message Date
yuboLee
ce4f466f0f Fix: some bugs about object tagging and bucket tagging
Signed-off-by: yuboLee <pangbolee@gmail.com>
2020-07-10 12:17:40 +08:00
yuboLee
9888905791 Fix: Change the logic of listing multipart uploads while just having upload id marker.
Signed-off-by: yuboLee <pangbolee@gmail.com>
2020-06-17 14:01:33 +08:00
wenjia322
5b587bf0ce enhancement: add 'Expires' and 'Cache-Control' when putObject/copyObject/getObject/headObject
Signed-off-by: wenjia322 <buaa1214wwj@126.com>
2020-05-29 10:57:13 +08:00
张墨飞
0bbb11014b
Enhancement: case sensitive content disposition header in response
Signed-off-by: 张墨飞 <zhangmofei@jd.com>
2020-05-21 17:39:20 +08:00
张墨飞
a87d8dcfcb Merge branch 'master' into pr/574 2020-05-21 17:37:36 +08:00
yuboLee
6eb165c895 Add support for header Content-Disposition
Signed-off-by: yuboLee <pangbolee@gmail.com>
2020-05-21 16:00:38 +08:00
Mofei Zhang
df4b7f9a42
Fix: parallel-safe issue in conn pool and metanode conn serve
1. Fix: parallel-safe issue in conn pool and metanode conn serve
2. Fix: nil pointer issue when list parts for non-exist uploadId
3. Enhancement: validate read size while read from connnect.
4. Enhancement: clean up useless data on failure while upload part.
5. Enhancement: generate ETag if do not exist when listing.
6. Enhancement: include error message when formatting packet to string.
7. Enhancement: improve compatile with old version SDK.
8. Enhancement:  success when retry add exist multipart part.

Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
Signed-off-by: 张墨飞 <zhangmofei@jd.com>
2020-05-21 12:28:18 +08:00
yuboLee
b74bf88b2f Fix: rewrite copy object function
Signed-off-by: yuboLee <pangbolee@gmail.com>
2020-05-19 11:19:02 +08:00
yuboLee
14d3d64ab4 Enhancement: add support for parallel download
Signed-off-by: yuboLee <pangbolee@gmail.com>
2020-05-08 17:39:05 +08:00
Mofei Zhang
01240bd867
Enhancement: partial support user-defined metadata
The PutObject interface supports setting user-defined metadata. The
GetObject and HeadObject interfaces can correctly return the stored
user-defined metadata.

Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
2020-05-06 00:52:04 +08:00
Mofei Zhang
a4ec2c88d5
Enhancement: improve tagging storage and add tests
1. Add tests for tagging operations.
2. Support setup tagging when put an object.
3. Fix routing issue on DeleteObjectTagging interface.
4. Improve tagging encoding for storage.

Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
2020-05-05 22:38:34 +08:00
Mofei Zhang
323e529ee0
Enhancement: make ETag versioned
When ETag is stored, it is versioned by encoding, which can make
the file system interface and object storage interface more closely
integrated.

Referring to the Amazon AWS S3 Developer Guide:
"Amazon S3 response includes an ETag that uniquely identifies the
combined object data. This ETag will not necessarily be an MD5 hash
of the object data."

When a new object is written to ChubaoFS through the object storage
interface, ChubaoFS calculates the ETag value for it, and uses the
modification time of the object as its version information when
encoding and storing.

If this file is modified by the file system interface, the ETag of
this file will be invalid because the version information will be
inconsistent with modification time.

After the object storage interface finds that the ETag is invalid,
it will automatically generate a new ETag matching its modification
time.

Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
2020-05-05 12:56:00 +08:00
Mofei Zhang
715b70973d
Fix: parallel-safe issue while batch get xattrs
Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
2020-05-04 00:28:19 +08:00
Mofei Zhang
c9bb74d718
Fix: xml element of DeleteResult
Fix xml element of DeleteResult.

Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
2020-04-30 16:46:25 +08:00
Mofei Zhang
4f927486a2
Fix: too many http transport goroutine in process
We found thousands of http transport goroutines in a process that has
been running for several weeks.
The master client creates a new http client instance every time it sends
an http request, and these instances do not call the method provided by
them to release the restricted connection after use. Try to use
singleton http client to solve this problem.

Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
2020-04-23 18:30:47 +08:00
Mofei Zhang
5c7c9980eb
Fix: precondition parsing issue
Fix the parsing issue of the two preconditions of If-Match and
If-None-Match.

We found that the request sent through the AWS S3 SDK included
double quotes for the values of these two preconditions.

This part is not specified in the AWS S3 API Reference.

Affected APIs: HeadObject, GetObject

Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
2020-04-22 17:25:19 +08:00
yuboLee
8b42c264c9 Fix:change object last modified time zone to UTC
Signed-off-by: yuboLee <pangbolee@gmail.com>
2020-04-22 13:27:35 +08:00
Mofei Zhang
90f58bb20b
Enhancement: increase logging information
Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
2020-04-21 01:41:46 +08:00
Mofei Zhang
a01a4f986b
Fix: empty result due to file deletion during list operation
During the process of scanning the child nodes of the current
directory, there may be other parallel operations that may
delete the current directory.
If got the syscall.ENOENT error when invoke readdir, it means
that the above situation has occurred.
At this time, stops process and returns success.

Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
2020-04-18 21:32:39 +08:00
xuxihao
176475a671 Fix: using local time to replace UTC in S3 modify action
Signed-off-by: xuxihao <xuxihao3@jd.com>
2020-04-16 17:46:41 +08:00
Mofei Zhang
7a57837f74
Fix: third-party license information
Adjust the format of the license header information of the third-party
code used to make the format more compliant. The NOTICE file supplements
the third-party code NOTIC information and explains the use of the code.

Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
2020-04-14 19:29:39 +08:00
yuboLee
c28e4a8b0c Enhancement: add conditional parameter support
Implemented the following conditional parameters in the GetObject
and HeadObject interfaces:
- If-Match
- If-Modified-Since
- If-None-Match
- If-Unmodified-Since

Signed-off-by: yuboLee <pangbolee@gmail.com>
2020-04-10 15:17:49 +08:00
Mofei Zhang
509d96c3d1
Enhancement: folder operations in S3 APIs
Supports folder operations in the same way as Amazon AWS S3.
  - Get folder meta info by HeadObject interface.
  - Create folder when header specifies Content-Type as
    application/directory and Content-Length as 0 on PutObject interface.
  - Delete an empty folder by DeleteObject interface.
  - The GetObject interface responds normally when the target is an
    existing directory.
  - Differentiate folders and files on the ListObject interface through the
    CommonPrefix property (already supported).

Following object storage interface haven been implemented folder operations:
  - HeadObject
  - GetObject
  - DeleteObject
  - DeleteObjects
  - ListObjects
  - ListObjectsV2

Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
2020-03-30 17:01:45 +08:00
Mofei Zhang
bdb1aa1ffd
Enhancement: optional not including ETag
When the object storage HeadObject and GetObject have no etag
information in the extended attributes of the file, the ETag header is
not returned. This solves the problem of data verification failure when
reading files written through the file system interface using the AWS S3
SDK through the object storage interface to a certain extent.

Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
2020-03-26 19:08:38 +08:00
Mofei Zhang
4ab5ccae7d
Enhancement: remove unused xattr fields in transport.
The list xattrs interface of posix only needs to specify all xattr
keys under the inode, and does not need the values of these keys.
Refactor the list xattr related interface in the metadata and only
transfer keys to optimize performance.

Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
2020-03-22 21:52:01 +08:00
Mofei Zhang
8b3d6aa3c5
Enhancement: multiple enhancements and fixes
Enhancement: validate user policy when mount volume.
Enhancement: when an object node loads a volume, different volumes do not block each other.
Enhancement: when checking policies, check user permissions before checking volume policies to reduce the overhead of loading volumes.
Enhancement: release connection pool when releasing meta wrapper resources.
Enhancement: the object node automatically releases the deleted volume.
Fix: response when deleting non-existing files using Object Storage
Interface.
Fix: url parameter parsing issue of signature algorithm V2.

Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
2020-03-22 21:02:28 +08:00
Mofei Zhang
ddfd8b7c3f
Enhancement: improve error parsing for master APIs
Enhancement: improve error parsing for master APIs.
Fix: status code of DelteBucket ans DeleteObjects API.
Fix: url signature parsing of signature algorithm V2.
Add: s3tests framework for compatibility test.

Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
2020-03-22 08:31:51 +08:00
Mofei Zhang
c2f057069d
Merge branch 'master' into object-store
Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
2020-03-20 01:11:58 +08:00
Mofei Zhang
55268cbe7e
Fix: incorrect content length when get ojbect with range
Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
2020-03-19 17:33:23 +08:00
Mofei Zhang
270df7fc4a
Merge branch 'master' into object-store
Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
2020-03-18 09:47:59 +08:00
Mofei Zhang
5bf657f2eb
Fix: error while list objects with multi-level directory prefix
Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
2020-03-17 21:13:14 +08:00
Mervin
fbbe1e0a7e
Refactor: param parse in object storage interface handlers
Signed-off-by: Mervin <mofei2816@gmail.com>
2020-03-10 00:49:13 +08:00
Mervin
a78ce3ad84
Fix: log output of getObjectXAttrHandler
Signed-off-by: Mervin <mofei2816@gmail.com>
2020-03-09 10:35:34 +08:00
Mervin
69d2f5a07d
Add: object storage api for list extend attributes
Signed-off-by: Mervin <mofei2816@gmail.com>
2020-03-09 01:06:30 +08:00
Mofei Zhang
aec409ffcf Refactor: using middleware for policy valication.
Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
2020-02-27 20:36:28 +08:00
Mofei Zhang
4979d728b2 Add: configuration for signature ignore actions
Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
2020-02-26 00:00:32 +08:00
Mofei Zhang
d5da6fa573
Add: object storage interface for bucket tagging put and get.
Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
2020-02-05 17:47:15 +08:00
Mofei Zhang
0009306a10
Enhancement: object storage api for object tagging operations
Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
2020-02-04 21:11:32 +08:00
wenjia322
0ea6447516 feature: cache authnode-info in objectnode and check user policy before calling handle function
Signed-off-by: wenjia322 <buaa1214wwj@126.com>
2020-01-08 18:36:04 +08:00
Mofei Zhang
b4434486c9
fix: unit test building issues and log format pattern issues.
Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
2019-12-20 18:19:01 +08:00
Mofei Zhang
d609fedb5c feature: object storage interface
Add ObjectNode provides S3-compatibile APIs.
Fusion Storage interface expose two interface (POSIX and S3-compatible) for file operation.

Signed-off-by: Mofei Zhang <mofei2816@gmail.com>
2019-12-17 17:36:53 +08:00