Skip to content

fix: normalize default partitions in in-memory persisters - #983

Open
MIRS571 wants to merge 1 commit into
apache:mainfrom
MIRS571:codex/fix-memory-default-partition
Open

MIRS571 wants to merge 1 commit into
apache:mainfrom
MIRS571:codex/fix-memory-default-partition

Conversation

@MIRS571

@MIRS571 MIRS571 commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Follow-up to the non-blocking default-partition suggestion in #958.

The in-memory persisters currently store a checkpoint under the raw None key but return partition_key="" in its metadata. Reloading with that returned key misses the checkpoint. SQLite already normalizes both inputs to the same default partition.

Changes

  • Normalize only None to "" in synchronous and asynchronous in-memory save/load/list operations, including stored checkpoint metadata.
  • Preserve non-empty keys verbatim and retain non-inserting load behavior.
  • Add 16 parameterized regression cases for alias lookups, returned-key reloads, mixed-key histories, duplicate sequence IDs, multiple applications, missing reads, and named-partition isolation. Synchronous lookup cases also run against SQLite as a control.
  • Document the compatibility change.

Compatibility

None and "" are now aliases, not two isolated in-memory partitions. Applications using both for the same app_id share a checkpoint history. Existing last-save semantics remain unchanged, including when selecting a specific sequence ID. Callers requiring separate partitions should use distinct non-empty string keys. SQLite behavior is unchanged.

How I tested this

On Python 3.11:

  • Before the fix, the initial new regression cases produced 10 failures and 6 passes.
  • python -m pytest tests/core/test_persistence.py -q: 66 passed.
  • python -m pytest tests/core -q -k "not test_visualize_dot_output": 446 passed, 4 deselected. The complete core run was attempted; those four graph-rendering cases cannot run locally because the Graphviz dot executable is absent.
  • Black, isort, flake8, AST, whitespace, EOF and ASF-header pre-commit checks passed on the changed files. The frontend hook was skipped because this change contains no frontend files.
  • git diff --check passed.

Notes

The complete repository test suite, other Python versions and the Sphinx documentation build were not run locally.

Checklist

  • Informative title and one focused goal.
  • Applicable pre-commit checks passed, with the frontend exclusion noted above.
  • Changed behavior is covered by regression tests.
  • Compatibility behavior and class documentation are updated.

@github-actions github-actions Bot added area/core Application, State, Graph, Actions area/storage Persisters, state storage area/website burr.apache.org website labels Oct 18, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core Application, State, Graph, Actions area/storage Persisters, state storage area/website burr.apache.org website

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant