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

enable batch expiry option in trace #4964

Merged
merged 1 commit into from
Jun 20, 2024

Conversation

prakashsvmx
Copy link
Member

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

enable batch expiry option in trace

Motivation and Context

ability to trace batch expiry calls

How to test this PR?

Build this PR

make build

Create a sample batch expiry job config yaml

# batch-expiry-test.yaml
expire:
  apiVersion: v1
  bucket: test-bucket 
  rules:
    - type: object  
      olderThan: 24h # 10days * 24  
      purge:
          retainVersions: 0
  retry:
    attempts: 10 
    delay: 500ms 

Setup data

mc mb local22/test-bucket
# Optional 
# mc version enable local22/test-bucket

# temporarily set public for setting up data
mc anonymous set public  local22/test-bucket

#Populate data
 for i in {11..210};  do  day=$((i % 31 + 1)); formatted_day=$(printf "%02d" $day); date_string="2024-03-${formatted_day}T17:19:03.115209866-08:00";   curl -k -X PUT http://0.0.0.0:22000/test-bucket/$i.txt -d "" -H "X-Minio-Source-Mtime: $date_string"
;  done


### Run the job
`./mc batch start local22 ./batch-expiry.yaml`


### Observe the trace result

Trace Result

#Un versioned bucket

➜ ./mc admin trace local22 --call bexp                       
          
2024-06-20T10:18:32.899 [BATCHEXPIRE] Expire() (job-name=TUK88yqEkpyzCSzMyZLp88:-1,attempts=1st) 127.0.0.1:22000 177.txt (versionID=) 562.891µs
...

# Versioned Bucket

➜ ./mc admin trace local22 --call bexp

2024-06-20T10:19:39.744 [BATCHEXPIRE] Expire() (job-name=nsfatSoHdv8EK8ma3aZFHF:-1,attempts=1st) 127.0.0.1:22000 100.txt (versionID=42b67ad7-8bfe-41ea-922f-1256674ec4ed) 213.185µs
...

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

@harshavardhana harshavardhana merged commit b72bd79 into minio:master Jun 20, 2024
7 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.

2 participants