sodonnel opened a new pull request, #12204: URL: https://github.com/apache/ozone/pull/12204
## What changes were proposed in this pull request? This is an alternative solution to #12192 but without a layout change and much reduced lines of code. The problem is that an overwrite key (atomic overwrite or non atomic overwrite) inherits the creationTime of the key from the original, which could be very old. If the openKeyDeletingService then runs while the key is open, it will get deleted. The solution here, is to use the modification time to gate deleting the file, as the modification is always the current time and is not inherited. There is one behavior change in this solution. The criteria for removing an open key is now: `max(creationTime, modificationTime) > threshold` This means that a lazy writer that is allocating blocks very slowly will adjust the modification time each time a block is added and that would extent the time the key spends on the open key table. I believe that is an improvement as in that case the key is still being written to and hence we should avoid deleting it if possible. This change doesn't need a version gate, as no persisted data is changed. Any keys deleted are replayed via Ratis on the followers. So if the leader is running code with this fix, it will avoid deleting these "open but should not be removed" keys. If the follower is upgraded it just replays the deletes and doesn't run the deleting service. If the leader is not upgraded, it will still delete open keys we don't want it to, but they will still be reflected consistently on the followers. ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-16851 ## How was this patch tested? New unit test added. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
