Skip to content

[FLINK-34246][runtime] Add option to only archive failed jobs to history server - #29015

Open
argoyal2212 wants to merge 1 commit into
apache:masterfrom
argoyal2212:argoyal+01/history-server-archive-only-failed-jobs
Open

[FLINK-34246][runtime] Add option to only archive failed jobs to history server#29015
argoyal2212 wants to merge 1 commit into
apache:masterfrom
argoyal2212:argoyal+01/history-server-archive-only-failed-jobs

Conversation

@argoyal2212

Copy link
Copy Markdown
Contributor

What is the purpose of the change

History server archival currently writes an archive to jobmanager.archive.fs.dir for every job that reaches a globally terminal state (FINISHED, CANCELED, FAILED). For clusters running many short-lived batch jobs, this creates a large number of archive files even though most users primarily care about investigating failed jobs.

This PR adds an opt-in option to only archive jobs that reached the FAILED state, reducing the number of files written to the archive directory.

Brief change log

  • Added jobmanager.archive.only-failed-jobs (default false, backward compatible) to JobManagerOptions.
  • Dispatcher#jobReachedTerminalState now skips calling the HistoryServerArchivist for non-FAILED terminal jobs when the option is enabled. The submitFailedJob path is unaffected since it always represents a FAILED job.
  • Regenerated docs/layouts/shortcodes/generated/job_manager_configuration.html.

Verification

  • Added DispatcherResourceCleanupTest#testNotArchivingFinishedJobToHistoryServerWhenOnlyFailedJobsConfigured, asserting a FINISHED job is not archived when the option is enabled, while cleanup/termination still proceed normally.
  • Ran DispatcherResourceCleanupTest (18/18 passed) and DispatcherTest (48/48 passed).

Does this pull request potentially affect one of the following parts

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): no (new ConfigOption, backward compatible, default preserves existing behavior)
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? Yes
  • If yes, how is the feature documented? Documented via the generated configuration docs (ConfigOption javadoc + regenerated HTML).

…ory server

Adds jobmanager.archive.only-failed-jobs (default false) to skip archiving finished/canceled/suspended jobs to the history server.
@flinkbot

flinkbot commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

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