Skip to content

[InvocationStatus] Add exact ID selection and batched multi-get point reads#5046

Open
AhmedSoliman wants to merge 2 commits into
mainfrom
pr5046
Open

[InvocationStatus] Add exact ID selection and batched multi-get point reads#5046
AhmedSoliman wants to merge 2 commits into
mainfrom
pr5046

Conversation

@AhmedSoliman

@AhmedSoliman AhmedSoliman commented Jul 15, 2026

Copy link
Copy Markdown
Member

Keep equality and IN predicates as exact ID selections in the DataFusion filter layer instead of collapsing large sets into scan ranges. This lets point-lookup tables preserve the user's requested IDs while range-scan tables can still convert the same selection back to bounds.

Teach the partitioned table provider to group exact point reads by Restate partition when the scanner can re-fetch the exact IDs itself. Use that for sys_invocation_status by adding an InvocationIdSet scan path backed by bounded RocksDB multi-get batches.

Split partition-store inclusive key-range scans into single-prefix and total-order variants, and use total-order scans when invocation-status, journal, or journal-events ID bounds span multiple partition keys. This preserves correctness for range-scan consumers of exact ID selections.

Adapt the worker cleaner to the fallible stream shape used by the new invocation-status scan path, and add scan-mode coverage for the new total-order range variant.


Stack created with Sapling. Best reviewed with ReviewStack.

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown

Test Results

  8 files  ±0    8 suites  ±0   5m 14s ⏱️ +12s
 61 tests ±0   61 ✅ ±0  0 💤 ±0  0 ❌ ±0 
268 runs  ±0  268 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 217b192. ± Comparison against base commit 47c66b3.

♻️ This comment has been updated with latest results.

@AhmedSoliman AhmedSoliman marked this pull request as ready for review July 15, 2026 15:53

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5754ad5895

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +188 to +190
Some(selection) if selection.keys.len() > 4096 => {
itertools::Either::Left(Some((partition_id, partition)).into_iter())
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Do not bypass grouped point reads above 4096 keys

For sys_invocation_status, with_grouped_invocation_id("id") enables PerPartition fanout, but this guard runs before the PerPartition arm, so an id IN (...) with more than 4096 distinct partition keys schedules every live partition instead of only partitions containing requested IDs. On partitions with no matching ID, InvocationIdFilter::new returns no ID selection and the status table converts that to a PartitionKey scan, causing unnecessary full partition scans; the per-key safety limit should not disable the grouped path because it creates at most one scan per Restate partition.

Useful? React with 👍 / 👎.

NOT IN (...) and != predicates enumerate excluded values, but the partition-key extractor and the entry-id/invocation-id filters ignored InList::negated and built lookup sets or ranges from those excluded IDs.

Reject negated IN lists in those extractors so DataFusion keeps them as normal filters instead of treating them as positive lookup inputs.

Cover the sys_invocation_status regression with excluded and retained invocation IDs on different partition keys, and keep sys_vqueue_entry_status coverage for the same NOT IN behavior.
… reads

Keep equality and IN predicates as exact ID selections in the DataFusion filter layer instead of collapsing large sets into scan ranges. This lets point-lookup tables preserve the user's requested IDs while range-scan tables can still convert the same selection back to bounds.

Teach the partitioned table provider to group exact point reads by Restate partition when the scanner can re-fetch the exact IDs itself. Use that for sys_invocation_status by adding an InvocationIdSet scan path backed by bounded RocksDB multi-get batches.

Split partition-store inclusive key-range scans into single-prefix and total-order variants, and use total-order scans when invocation-status, journal, or journal-events ID bounds span multiple partition keys. This preserves correctness for range-scan consumers of exact ID selections.

Adapt the worker cleaner to the fallible stream shape used by the new invocation-status scan path, and add scan-mode coverage for the new total-order range variant.
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.

1 participant