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

Avoid overwriting object tags when changing lock #9794

Merged
merged 1 commit into from Jun 10, 2020

Conversation

poornas
Copy link
Contributor

@poornas poornas commented Jun 9, 2020

configuration via PutObjectRetention/PutObjectLegalHold
API's

Description

Motivation and Context

Currently user set tags on a object get overwritten when retention or legal hold configurations are changed.

How to test this PR?

Set tags using mc tag on a object in lock enabled bucket
set mc legalhold to enable legal hold
With this PR tags would not get overwritten

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • 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 needed
  • Unit tests needed
  • Functional tests needed (If yes, add mint PR # here: )

configuration via PutObjectRetention/PutObjectLegalHold
API's
Copy link
Contributor

@kannappanr kannappanr left a comment

Choose a reason for hiding this comment

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

Tested LGTM

@minio-trusted
Copy link
Contributor

Mint Automation

Test Result
mint-large-bucket.sh ✔️
mint-fs.sh ✔️
mint-dist-xl.sh ✔️
mint-gateway-s3.sh ✔️
mint-gateway-nas.sh ✔️
mint-xl.sh more...
mint-gateway-azure.sh more...

9794-d079434/mint-gateway-azure.sh.log:

Running with
SERVER_ENDPOINT:      minio-dev7.minio.io:31333
ACCESS_KEY:           minioazure
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 415bf63b89f0:/mint/log /tmp/mint-logs'

(1/15) Running aws-sdk-go tests ... done in 8 seconds
(2/15) Running aws-sdk-java tests ... done in 2 seconds
(3/15) Running aws-sdk-php tests ... done in 1 minutes and 9 seconds
(4/15) Running aws-sdk-ruby tests ... done in 16 seconds
(5/15) Running awscli tests ... done in 2 minutes and 11 seconds
(6/15) Running healthcheck tests ... done in 0 seconds
(7/15) Running mc tests ... done in 3 minutes and 21 seconds
(8/15) Running minio-dotnet tests ... done in 1 minutes and 34 seconds
(9/15) Running minio-go tests ... done in 6 minutes and 29 seconds
(10/15) Running minio-java tests ... FAILED in 23 minutes and 37 seconds
{
  "name": "minio-java",
  "function": "listIncompleteUploads(final String bucketName, final String prefix, final boolean recursive)",
  "args": "prefix: minio, recursive: true",
  "duration": 1603,
  "status": "FAIL",
  "error": "java.io.EOFException >>> [okio.RealBufferedSink.write(RealBufferedSink.java:115), io.minio.HttpRequestBody.writeTo(HttpRequestBody.java:78), okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:83), okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147), okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45), okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147), okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121), okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:94), okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147), okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121), okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93), okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147), okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:125), okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147), okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121), okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:264), okhttp3.RealCall.execute(RealCall.java:93), io.minio.MinioClient.execute(MinioClient.java:1097), io.minio.MinioClient.execute(MinioClient.java:1236), io.minio.MinioClient.executePut(MinioClient.java:1410), io.minio.MinioClient.executePut(MinioClient.java:1424), io.minio.MinioClient.uploadPart(MinioClient.java:5492), io.minio.MinioClient.putObject(MinioClient.java:3740), io.minio.MinioClient.putObject(MinioClient.java:3870), FunctionalTest.listIncompleteUploads_test3(FunctionalTest.java:1835), FunctionalTest.runTests(FunctionalTest.java:4053), FunctionalTest.main(FunctionalTest.java:4192)]"
}
(10/15) Running minio-js tests ... FAILED in 1 minutes and 47 seconds
{
  "name": "minio-js",
  "function": "fPutObject(bucketName, objectName, filePath, metaData)",
  "args": "bucketName:minio-js-test-3c3f6f9b-29a7-476f-9fbd-dcd1acf1e9fd, objectName:datafile-65-MB, filePath:/tmp/datafile-65-MB",
  "duration": 810,
  "status": "FAIL",
  "error": "Error: write ECONNRESET at afterWriteDispatched (internal/stream_base_commons.js:154:25) at writeGeneric (internal/stream_base_commons.js:145:3) at Socket._writeGeneric (net.js:786:11) at Socket._write (net.js:798:8) at doWrite (_stream_writable.js:397:12) at clearBuffer (_stream_writable.js:550:7) at Socket.Writable.uncork (_stream_writable.js:332:7) at connectionCorkNT (_http_outgoing.js:707:8) at processTicksAndRejections (internal/process/task_queues.js:83:21)"
}
(10/15) Running minio-py tests ... done in 9 minutes and 55 seconds
(11/15) Running s3cmd tests ... done in 1 minutes and 22 seconds
(12/15) Running s3select tests ... done in 1 minutes and 1 seconds
(13/15) Running security tests ... done in 0 seconds

Executed 13 out of 15 tests successfully.

9794-d079434/mint-xl.sh.log:

Running with
SERVER_ENDPOINT:      minio-dev6.minio.io:32390
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 ae171112bce9:/mint/log /tmp/mint-logs'

(1/15) Running aws-sdk-go tests ... done in 0 seconds
(2/15) Running aws-sdk-java tests ... done in 2 seconds
(3/15) Running aws-sdk-php tests ... done in 41 seconds
(4/15) Running aws-sdk-ruby tests ... done in 2 seconds
(5/15) Running awscli tests ... done in 2 minutes and 21 seconds
(6/15) Running healthcheck tests ... done in 0 seconds
(7/15) Running mc tests ... done in 47 seconds
(8/15) Running minio-dotnet tests ... done in 32 seconds
(9/15) Running minio-go tests ... done in 42 seconds
(10/15) Running minio-java tests ... done in 48 seconds
(11/15) Running minio-js tests ... done in 51 seconds
(12/15) Running minio-py tests ... done in 57 seconds
(13/15) Running s3cmd tests ... FAILED in 8 seconds
{
  "name": "s3cmd",
  "duration": "2698",
  "function": "test_get_object_multipart",
  "status": "FAIL",
  "error": "\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n    An unexpected error has occurred.\n  Please try reproducing the error using\n  the latest s3cmd code from the git master\n  branch found at:\n    https://github.com/s3tools/s3cmd\n  and have a look at the known issues list:\n    https://github.com/s3tools/s3cmd/wiki/Common-known-issues-and-their-solutions\n  If the error persists, please report the\n  following lines (removing any private\n  info as necessary) to:\n   s3tools-bugs@lists.sourceforge.net\n\n\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\nInvoked as: /usr/local/bin/s3cmd --config /tmp/.s3cmd-20208/s3cfg get s3://s3cmd-test-bucket-22486/s3cmd-test-object-17390 s3cmd-test-object-17390.downloaded\nProblem: <class 'ConnectionResetError: [Errno 104] Connection reset by peer\nS3cmd:   2.1.0\npython:   3.6.9 (default, Apr 18 2020, 01:56:04) \n[GCC 8.4.0]\nenvironment LANG=C.UTF-8\n\nTraceback (most recent call last):\n  File \"/usr/local/bin/s3cmd\", line 3121, in <module>\n    rc = main()\n  File \"/usr/local/bin/s3cmd\", line 3030, in main\n    rc = cmd_func(args)\n  File \"/usr/local/bin/s3cmd\", line 604, in cmd_object_get\n    response = s3.object_get(uri, dst_stream, destination, start_position = start_position, extra_label = seq_label)\n  File \"/usr/local/lib/python3.6/dist-packages/S3/S3.py\", line 726, in object_get\n    response = self.recv_file(request, stream, labels, start_position)\n  File \"/usr/local/lib/python3.6/dist-packages/S3/S3.py\", line 1733, in recv_file\n    data = http_response.read(this_chunk)\n  File \"/usr/lib/python3.6/http/client.py\", line 459, in read\n    n = self.readinto(b)\n  File \"/usr/lib/python3.6/http/client.py\", line 503, in readinto\n    n = self.fp.readinto(b)\n  File \"/usr/lib/python3.6/socket.py\", line 586, in readinto\n    return self._sock.recv_into(b)\nConnectionResetError: [Errno 104] Connection reset by peer\n\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n    An unexpected error has occurred.\n  Please try reproducing the error using\n  the latest s3cmd code from the git master\n  branch found at:\n    https://github.com/s3tools/s3cmd\n  and have a look at the known issues list:\n    https://github.com/s3tools/s3cmd/wiki/Common-known-issues-and-their-solutions\n  If the error persists, please report the\n  above lines (removing any private\n  info as necessary) to:\n   s3tools-bugs@lists.sourceforge.net\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
}
(13/15) Running s3select tests ... done in 2 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 3d3b75f into minio:master Jun 10, 2020
@poornas poornas deleted the fixtags branch June 13, 2022 22:48
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

4 participants