Skip to content

Conversation

@jayshrivastava
Copy link
Collaborator

@jayshrivastava jayshrivastava commented Aug 22, 2025

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>>>,
Copy link
Collaborator Author

@jayshrivastava jayshrivastava Aug 24, 2025

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
Copy link
Collaborator

@gabotechs gabotechs left a comment

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

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
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
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.

3 participants