Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tiering] Support remote tiers with object versioning #12342

Merged
merged 3 commits into from
Jun 3, 2021

Conversation

donatello
Copy link
Member

@donatello donatello commented May 20, 2021

Description

  • Adds versioning support for S3 based remote tiers that have versioning
    enabled. This ensure that when reading or deleting we specify the specific
    version ID of the object. In case of deletion this is important to ensure that
    the object version is actually deleted instead of simply being marked for
    deletion.

  • Stores the remote object's version id in the tier-journal. Tier-journal file
    version is bumped up to support this change.

  • Azure and GCS support for versioning to be added subsequently.

How to test this PR?

  1. On main/local myminio instance:
export _MINIO_DEBUG_REMOTE_TIERS_IMMEDIATELY=MINIOTIER2 # To transition immediately
rm -rf /tmp/disk-main-*
MINIO_ROOT_USER=minio` MINIO_ROOT_PASSWORD=minio123 ./minio server /tmp/disk-main-{1...4}
  1. For remote reminio instance:
rm -rf /tmp/disk-remote-*
MINIO_ROOT_USER=minio MINIO_ROOT_PASSWORD=minio123 ./minio server --address :9008 /tmp/disk-remote-{1...4}
mc mb reminio/testbucket
mc version enable reminio/testbucket
  1. On myminio:
mc mb myminio/testbucket
mc version enable myminio/testbucket

mc admin tier add s3 myminio MINIOTIER2 --endpoint http://localhost:9008 --access-key minio --secret-key minio123 --bucket testbucket

mc ilm add myminio/testbucket --transition-days 1 --storage-class MINIOTIER2
  1. Copy an object:
fallocate -l50M /tmp/bigobj
mc  cp /tmp/bigobj myminio/testbucket/

Observe that in some time the object is transitioned to remote (with mc stat).
Then delete the local object with mc rm --version-id VER_ID myminio/testbucket/bigobj and in some time (in about 30+ minutes), the remote is deleted as well (not just having a delete marker created).

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Optimization (provides speedup with no functional changes)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • Fixes a regression (If yes, please add commit-id or PR # here)
  • Documentation updated
  • Unit tests added/updated

@donatello donatello requested a review from krisis May 20, 2021 19:49
cmd/storage-datatypes.go Outdated Show resolved Hide resolved
cmd/bucket-lifecycle.go Outdated Show resolved Hide resolved
cmd/tier-journal.go Show resolved Hide resolved
cmd/warm-backend-gcs.go Outdated Show resolved Hide resolved
@donatello donatello force-pushed the ilm-versioned-remote branch 3 times, most recently from 5cf7a62 to 9539106 Compare May 24, 2021 21:29
@donatello donatello requested a review from klauspost May 24, 2021 21:29
Copy link
Contributor

@klauspost klauspost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (though more people should take a look)

@donatello donatello force-pushed the ilm-versioned-remote branch 2 times, most recently from 87b2a6d to bcae3e8 Compare May 27, 2021 20:54
@donatello
Copy link
Member Author

Updated test instructions and fixed a bug.

cmd/bucket-lifecycle.go Outdated Show resolved Hide resolved
cmd/object-api-datatypes.go Outdated Show resolved Hide resolved
cmd/storage-datatypes.go Outdated Show resolved Hide resolved
cmd/tier-journal.go Outdated Show resolved Hide resolved
donatello and others added 3 commits May 27, 2021 15:54
- Adds versioning support for S3 based remote tiers that have versioning
enabled. This ensure that when reading or deleting we specify the specific
version ID of the object. In case of deletion this is important to ensure that
the object version is actually deleted instead of simply being marked for
deletion.

- Stores the remote object's version id in the tier-journal. Tier-journal file
version is not bumped up as serializing the new jentry struct version is
compatible with old journals containing jentry's without the remote object
version id.

- `storageRESTVersion` is bumped up as FileInfo struct now includes a
`TransitionRemoteVersionID` member.

- Azure and GCS support for this feature will be added subsequently.
Co-authored-by: Krishnan Parthasarathi <krisis@users.noreply.github.com>
@minio minio deleted a comment from minio-trusted May 27, 2021
@minio-trusted
Copy link
Contributor

Mint Automation

Test Result
mint-large-bucket.sh ✔️
mint-fs.sh ✔️
mint-gateway-s3.sh ✔️
mint-erasure.sh ✔️
mint-dist-erasure.sh ✔️
mint-zoned.sh ✔️
mint-gateway-nas.sh ✔️
mint-compress-encrypt-dist-erasure.sh more...

12342-ce94acb/mint-compress-encrypt-dist-erasure.sh.log:

Running with
SERVER_ENDPOINT:      minio-c3.minio.io:30883
ACCESS_KEY:           minio
SECRET_KEY:           ***REDACTED***
ENABLE_HTTPS:         0
SERVER_REGION:        us-east-1
MINT_DATA_DIR:        /mint/data
MINT_MODE:            full
ENABLE_VIRTUAL_STYLE: 0

To get logs, run 'docker cp f46bb234ee0c:/mint/log /tmp/mint-logs'

(1/15) Running aws-sdk-go tests ... done in 2 seconds
(2/15) Running aws-sdk-java tests ... done in 1 seconds
(3/15) Running aws-sdk-php tests ... done in 43 seconds
(4/15) Running aws-sdk-ruby tests ... done in 4 seconds
(5/15) Running awscli tests ... done in 2 minutes and 13 seconds
(6/15) Running healthcheck tests ... done in 0 seconds
(7/15) Running mc tests ... done in 1 minutes and 14 seconds
(8/15) Running minio-dotnet tests ... done in 45 seconds
(9/15) Running minio-go tests ... done in 2 minutes and 20 seconds
(10/15) Running minio-java tests ... FAILED in 1 minutes and 25 seconds
{
  "name": "minio-java",
  "function": "composeObject()",
  "args": "[single source with offset]",
  "duration": 68,
  "status": "FAIL",
  "error": "error occurred\nErrorResponse(code = InvalidArgument, message = Range specified is not valid for source object, bucketName = minio-java-test-3q36q59, objectName = minio-java-test-33kb8uc, resource = /minio-java-test-3q36q59/minio-java-test-33kb8uc, requestId = 16831055E0001979, hostId = 29d4ca93-e906-4a0d-ac33-b28dcdd11c03)\nrequest={method=PUT, url=http://minio-c3.minio.io:30883/minio-java-test-3q36q59/minio-java-test-33kb8uc?uploadId=21c91bb2-e62b-4ad7-be8f-0ff5e7362d2b&partNumber=1, headers=x-amz-copy-source: /minio-java-test-3q36q59/minio-java-test-3b38d23\nx-amz-copy-source-range: bytes=2048-1048575\nx-amz-copy-source-if-match: cb92d17a904ccec2e6e23b8bb66245fb\nHost: minio-c3.minio.io:30883\nAccept-Encoding: identity\nUser-Agent: MinIO (Linux; amd64) minio-java/8.0.3\nContent-MD5: 1B2M2Y8AsgTpgAmY7PhCfg==\nx-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\nx-amz-date: 20210527T233051Z\nAuthorization: AWS4-HMAC-SHA256 Credential=*REDACTED*/20210527/us-east-1/s3/aws4_request, SignedHeaders=content-md5;host;x-amz-content-sha256;x-amz-copy-source;x-amz-copy-source-if-match;x-amz-copy-source-range;x-amz-date, Signature=*REDACTED*\n}\nresponse={code=400, headers=Accept-Ranges: bytes\nContent-Length: 390\nContent-Security-Policy: block-all-mixed-content\nContent-Type: application/xml\nServer: MinIO\nVary: Origin\nX-Amz-Request-Id: 16831055E0001979\nX-Xss-Protection: 1; mode=block\nDate: Thu, 27 May 2021 23:30:51 GMT\n}\n >>> [io.minio.MinioClient.execute(MinioClient.java:775), io.minio.MinioClient.uploadPartCopy(MinioClient.java:4804), io.minio.MinioClient.composeObject(MinioClient.java:1431), FunctionalTest.testComposeObject(FunctionalTest.java:2120), FunctionalTest.composeObjectTests(FunctionalTest.java:2145), FunctionalTest.composeObject(FunctionalTest.java:2300), FunctionalTest.runObjectTests(FunctionalTest.java:3758), FunctionalTest.runTests(FunctionalTest.java:3783), FunctionalTest.main(FunctionalTest.java:3927)]"
}
(10/15) Running minio-js tests ... done in 51 seconds
(11/15) Running minio-py tests ... done in 2 minutes and 55 seconds
(12/15) Running s3cmd tests ... done in 18 seconds
(13/15) Running s3select tests ... done in 7 seconds
(14/15) Running security tests ... done in 0 seconds

Executed 14 out of 15 tests successfully.

Deleting image on docker hub
Deleting image locally

@harshavardhana harshavardhana merged commit 30a3921 into minio:master Jun 3, 2021
@donatello donatello deleted the ilm-versioned-remote branch June 3, 2021 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants