Skip to content

do_get: use TTL map to store task state - #108

Merged
jayshrivastava merged 2 commits into
mainfrom
js/hook-up-ttl-map-2
Aug 25, 2025
Merged

do_get: use TTL map to store task state#108
jayshrivastava merged 2 commits into
mainfrom
js/hook-up-ttl-map-2

Conversation

@jayshrivastava

@jayshrivastava jayshrivastava commented Aug 22, 2025

Copy link
Copy Markdown
Collaborator

ttl_map: add remove() method and tests

The remove() method allows explicit deletion of entries from the TTLMap before they expire naturally.

do_get: use TTL map to store task state

The do_get call now evicts task state from the map after N calls where N
is the number of partitions. This is an approximation because we don't
track that unique partition ids are used, so we might evict early in case
of retries.

The TTLMap will also GC orphaned task state after the configured TTL period.

@jayshrivastava
jayshrivastava force-pushed the js/hook-up-ttl-map-2 branch 3 times, most recently from a8015cc to ed67281 Compare August 24, 2025 17:08
@jayshrivastava jayshrivastava changed the title Js/hook up ttl map 2 do_get: use TTL map to store task state Aug 24, 2025
pub(super) runtime: Arc<RuntimeEnv>,
#[allow(clippy::type_complexity)]
pub(super) stages: DashMap<StageKey, Arc<OnceCell<(SessionState, Arc<ExecutionStage>)>>>,
pub(super) stages: TTLMap<StageKey, Arc<OnceCell<TaskData>>>,

@jayshrivastava jayshrivastava Aug 24, 2025

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oncecell must be in an Arc so we can copy the oncecell after it has been initialized without resetting it

@jayshrivastava
jayshrivastava marked this pull request as ready for review August 24, 2025 22:14

@gabotechs gabotechs left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! just some minor comments, +1

Comment thread src/flight_service/do_get.rs Outdated
Comment thread src/flight_service/do_get.rs
The remove() method allows explicit deletion of entries from the TTLMap before they expire naturally.
The do_get call now evicts task state from the map after N calls where N
is the number of partitions. This is an approximation because we don't
track that unique partition ids are used, so we might evict early in case
of retries.

The TTLMap will also GC orphaned task state after the configured TTL period.
@jayshrivastava

Copy link
Copy Markdown
Collaborator Author

TYFR!

@jayshrivastava
jayshrivastava merged commit 03ffc02 into main Aug 25, 2025
3 checks passed
@jayshrivastava
jayshrivastava deleted the js/hook-up-ttl-map-2 branch August 25, 2025 21:52
@jayshrivastava

Copy link
Copy Markdown
Collaborator Author

Closes #90

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