-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Fix setTtl workflow and ttlbucket bugs #16933
Conversation
Automated checks report:
Some checks failed. Please fix the reported issues and reply 'alluxio-bot, check this please' to re-run checks. |
2a731f6
to
2d5ce5e
Compare
Automated checks report:
All checks passed! |
2f22aeb
to
84a1c9b
Compare
core/server/master/src/main/java/alluxio/master/file/meta/TtlBucket.java
Outdated
Show resolved
Hide resolved
core/server/master/src/main/java/alluxio/master/file/meta/TtlBucketList.java
Show resolved
Hide resolved
core/server/master/src/main/java/alluxio/master/file/InodeTtlChecker.java
Outdated
Show resolved
Hide resolved
and inode should load on inodettlchecker processing and be double checked on expiry. 2. setttl cmd should not set recursively on a directory, causing massive unnecessary setattr on children while dir ttl already supercede children ttl. 3. any inode failed during inodettlchecker process should add back to ttlbuckets for retry 4. Master.TTLInodes metrics can just be aggregated at time of gauging instead of atomic counter as it is not accurate during concurrent modification to ttlbuckets. 5. Fix race condition in TtlBucketList.insert(inode) where it might add to a bucket already got removed by ttlchecker (ALLUXIO-2821) 6. ttlbuckets should be polled first in each ttlchecker round to avoid concurrent modification while processing 7. add test cases for respecting dir ttl over children ttl.
…sing of ttlbucketlist
…ing inodes forever
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added two side notes. I actually didn;t look into the details, but if you think my review is relevant then I can take a much deeper look in a bit. Thanks!
core/server/master/src/main/java/alluxio/master/file/meta/TtlBucket.java
Outdated
Show resolved
Hide resolved
core/server/master/src/main/java/alluxio/master/file/meta/TtlBucket.java
Show resolved
Hide resolved
absolutely, feel free to take a deeper look! As I would really like to be reminded of anything regression from other components in master / in general. |
core/server/master/src/main/java/alluxio/master/file/InodeTtlChecker.java
Show resolved
Hide resolved
core/server/master/src/main/java/alluxio/master/file/InodeTtlChecker.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a bunch of comments, PTAL. Thanks! Most of them are minor except a few.
core/server/master/src/main/java/alluxio/master/file/InodeTtlChecker.java
Show resolved
Hide resolved
core/server/master/src/main/java/alluxio/master/file/meta/TtlBucket.java
Show resolved
Hide resolved
core/server/master/src/main/java/alluxio/master/file/meta/TtlBucket.java
Outdated
Show resolved
Hide resolved
core/server/master/src/main/java/alluxio/master/file/meta/TtlBucketList.java
Outdated
Show resolved
Hide resolved
.../test/java/alluxio/client/fs/concurrent/ConcurrentFileSystemMasterSetTtlIntegrationTest.java
Outdated
Show resolved
Hide resolved
core/server/master/src/main/java/alluxio/master/file/InodeTtlChecker.java
Show resolved
Hide resolved
core/server/master/src/main/java/alluxio/master/file/InodeTtlChecker.java
Show resolved
Hide resolved
core/server/master/src/main/java/alluxio/master/file/InodeTtlChecker.java
Show resolved
Hide resolved
.../test/java/alluxio/client/fs/concurrent/ConcurrentFileSystemMasterSetTtlIntegrationTest.java
Outdated
Show resolved
Hide resolved
.../test/java/alluxio/client/fs/concurrent/ConcurrentFileSystemMasterSetTtlIntegrationTest.java
Show resolved
Hide resolved
…eSystemMasterSetTtlIntegrationTest.java Co-authored-by: Jiacheng Liu <jiacheliu3@gmail.com>
…ucket.java Co-authored-by: Jiacheng Liu <jiacheliu3@gmail.com>
…ucket.java Co-authored-by: Jiacheng Liu <jiacheliu3@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks a lot for the work!
alluxio-bot, merge this please |
### What changes are proposed in this pull request? 1)setttl cmd on a big directory unnecessary setattr recursively, while dir ttl already supercedes children ttl. there's absolutely no reason to save ttl on children node individually. 2)ttlbucket unnecessarily saves Inode obj on heap unboundedly, where it could and should only save inodeid and load inode from inodestore to double check expiry during inodettlchecker processing. 3)fix race condition on ttlbucketlists from ttlchecker and insertion from foreground. 4)fix case where any expiration of inodes failed during ttlchecker it will never be retried again. ### Why are the changes needed? Reduce heavy GC when setttl on a huge folder / bug fixes as indicated above for ttl ### Does this PR introduce any user facing changes? yes. So now setTtl command on a dir will not set ttl attributes for all its children. pr-link: Alluxio#16933 change-id: cid-36ec524b2178220886cccb7a82de119bdcc8203f
What changes are proposed in this pull request?
1)setttl cmd on a big directory unnecessary setattr recursively, while dir ttl already supercedes children ttl. there's absolutely no reason to save ttl on children node individually.
2)ttlbucket unnecessarily saves Inode obj on heap unboundedly, where it could and should only save inodeid and load inode from inodestore to double check expiry during inodettlchecker processing.
3)fix race condition on ttlbucketlists from ttlchecker and insertion from foreground.
4)fix case where any expiration of inodes failed during ttlchecker it will never be retried again.
Why are the changes needed?
Reduce heavy GC when setttl on a huge folder / bug fixes as indicated above for ttl
Does this PR introduce any user facing changes?
yes. So now setTtl command on a dir will not set ttl attributes for all its children.