[FLINK-7196][blob] add a TTL to all transient BLOBs #4381
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
Transient BLOB files are currently only deleted manually and may thus linger around if not cleaned up. We should introduce a default cleanup time, i.e. a time-to-live (TTL), as a backup cleanup path.
Brief change log
TransientBlobService
, i.e.BlobServer
andTransientBlobCache
, gets an additional member keeping track of all expiry times of transient BLOBs.TransientBlobService
, its TTL will be set tocurrentTime + cleanupInterval
.TransientBlobCleanupTask
) is executed everycleanupInterval
seconds and deletes all expired transient BLOBs.2 * cleanupInterval
seconds before getting deleted automatically.Please note that this PR is based on #4359 in a series to implement FLIP-19.
Verifying this change
This change adds tests and can be verified as follows:
BlobServer
andTransientBlobCache
with and without a job ID) that after adding two transient BLOBs with further accesses only to one of them, that the accessed one remains and the other is deleted. For the existence check, however, there is a slight race condition: if the test is slow and delayed by 1s, the cleanup may kick in and the test may fail. This is hard to test otherwise without further intrusion into the blob store classes.Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: (no)Documentation