[FLINK-XXXXX][historyserver] Decouple remote archive retention from local processing limit - #29008
Open
argoyal2212 wants to merge 1 commit into
Open
Conversation
…ocal processing limit Adds historyserver.archive.retain-remote-beyond-local-limit (default false, backward compatible). When enabled, job archives beyond historyserver.archive.retained-jobs are no longer polled/processed locally, but are kept in the remote archive directory instead of being deleted. Such archives remain reachable on demand via the existing lazyFetchArchiveProactively on-demand fetch path when historyserver.archive.load.mode is set to LAZY. This closes a gap left after FLINK-39911/FLINK-40097 introduced the pluggable ArchiveStorage backend and on-demand lazy archive loading: retainedStrategy.shouldRetain() still gated both local processing and remote deletion together, so operators could not keep an unbounded remote archive history while only actively polling/caching a small recent window locally. - HistoryServerOptions: new HISTORY_SERVER_RETAIN_REMOTE_BEYOND_LOCAL_LIMIT option. - HistoryServerArchiveFetcher: new constructor overload taking the flag; scanArchives() now routes archives beyond the retained limit to a new cleanupLocalArchivesBeyondRetainedLimit() (local-only cleanup) instead of cleanupArchivesBeyondRetainedLimit() (local+remote) when enabled. - HistoryServer: reads and wires the new option into the job archive fetcher. - Regenerated docs/layouts/shortcodes/generated/history_server_configuration.html. - Added HistoryServerArchiveFetcherTest coverage for both the default (remote-deleted) and opted-in (remote-retained, still fetchable on-demand) behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
HistoryServerOptions.HISTORY_SERVER_RETAINED_JOBScurrently gates both (a) which archives theHistoryServerpolls/processes locally, and (b) which archives are deleted from the remote archive directory. This means operators cannot keep a large/unbounded remote job-archive history while only actively refreshing a small recent window locally — trimming the local processing window also deletes the "older" jobs remotely.This closes that gap, which is what FLIP-505 originally set out to solve, before FLIP-584/585 (FLINK-39911, FLINK-40097) landed a more general pluggable
ArchiveStoragebackend + on-demand lazy-fetch mechanism that already covers FLIP-505's other goals (per-job on-demand fetch, avoiding local disk/inode exhaustion via a pluggable storage backend). This PR adds the one remaining piece: decoupling remote retention from the local processing limit.Brief change log
historyserver.archive.retain-remote-beyond-local-limit(boolean, defaultfalse, fully backward compatible).HistoryServerArchiveFetcher.scanArchives(): when enabled, archives beyondhistoryserver.archive.retained-jobsare cleaned up locally only (newcleanupLocalArchivesBeyondRetainedLimit), leaving the remote archive intact, instead of callingcleanupArchivesBeyondRetainedLimit(which deletes both local and remote).lazyFetchArchiveProactivelypath whenhistoryserver.archive.load.mode=LAZY.HistoryServerreads and wires the new option into the job-archive fetcher (applications are unaffected — this only applies to job archives, matching FLIP-505's original scope).docs/layouts/shortcodes/generated/history_server_configuration.html.Verifying this change
This change added tests and can be verified as follows:
HistoryServerArchiveFetcherTest#testArchivesBeyondRetainedLimitAreDeletedFromRemoteByDefaultand#testArchivesBeyondRetainedLimitAreKeptRemotelyWhenConfigured, covering both storage backends (File/RocksDB), asserting: default behavior is unchanged (remote archive deleted beyond limit); with the flag enabled, the remote archive persists, is not locally cached, and is still fetchable on demand.HistoryServerArchiveFetcherTestpass locally.Does this pull request potentially affect one of the following parts?
@Public(Evolving): yes, one new@PublicEvolvingConfigOptionDocumentation