Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@shtripat
Copy link
Contributor

Community Contribution License

All community contributions in this pull request are licensed to the project maintainers
under the terms of the Apache 2 license.
By creating this pull request I represent that I have the right to license the
contributions to the project maintainers under the Apache 2 license.

Description

The condition were incorrect as we were comparing the filter value against the modification time object.

For example if created after filter date is after modification time of object, that means object was created before the filter time and should be skipped while replication because as per the filter we need only the objects created after the filter date.

Motivation and Context

How to test this PR?

  1. Create two instances of MinIO
  2. Create buckets in both instances
  3. Make bucket in first instance public mc anonymous set public ALIAS/BUCKET
  4. Load few objects using mc cp to first instance's bucket
  5. Load few instances with older Mtime value using curl command (for i in {1..20}; do curl -X PUT -k "https://minio2:9010/test-bucket/shu$i" -d @/etc/issue -H "X-Minio-Source-Mtime: 2013-03-12T16:19:03.115209866-08:00"; done)
  6. Create a batch replicate job with filter createdBefore filter
replicate:
    apiVersion: v1
    flags:
        filter:
          createdBefore: 2024-09-30T18:30:00Z
        notify:
            endpoint: ""
            token: ""
        retry:
            attempts: 3
            delay: 0s
    target:
        type: minio
        bucket: new-bucket
        prefix: ""
        endpoint: https://minio2:9010
        path: ""
        credentials:
            accessKey: minioadmin
            secretKey: minioadmin
            sessionToken: ""
    source:
        type: minio
        bucket: test-bucket
        prefix: []
        endpoint: ""
        path: ""
        credentials:
            accessKey: ""
            secretKey: ""
            sessionToken: ""
        snowball:
            disable: false
            batch: 100
            inmemory: true
            compress: false
            smallerThan: 5Mi
            skipErrs: true
keyrotate: null
expire: null
  1. Let the job complete and verify in the second instance that only the old objects are replicated

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)
  • Unit tests added/updated
  • Internal documentation updated
  • Create a documentation update request here

The condition were incorrect as we were comparing the filter
value against the modification time object.

For example if created after filter date is after modification
time of object, that means object was created before the filter
time and should be skipped while replication because as per the
filter we need only the objects created after the filter date.

Signed-off-by: Shubhendu Ram Tripathi <[email protected]>
@harshavardhana harshavardhana merged commit 96ca402 into minio:master Oct 18, 2024
21 checks passed
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.

4 participants