Skip to content

MSC4242: State DAGs (storage) - #19718

Merged
kegsay merged 17 commits into
developfrom
kegan/4242-storage
Sep 2, 2026
Merged

MSC4242: State DAGs (storage)#19718
kegsay merged 17 commits into
developfrom
kegan/4242-storage

Conversation

@kegsay

@kegsay kegsay commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Split out from #19425

Add storage functions needed for federation support for MSC4242:

  • get_missing_events_state_dag: will be used to satisfy /get_missing_events requests.
  • get_state_dag: will be used to satisfy /send_join requests.

Part of a series of 5x PRs to land the federation part of MSC4242 (storage, fedclient, serving, inbound-joins, inbound-pulls).

Pull Request Checklist

  • Pull request is based on the develop branch
  • Pull request includes a changelog file. The entry should:
    • Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from EventStore to EventWorkerStore.".
    • Use markdown where necessary, mostly for code blocks.
    • End with either a period (.) or an exclamation mark (!).
    • Start with a capital letter.
    • Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
  • Code style is correct (run the linters)

@kegsay
kegsay requested a review from a team as a code owner April 22, 2026 14:57
@kegsay
kegsay requested a review from MadLittleMods April 22, 2026 14:58
Comment thread synapse/storage/databases/main/event_federation.py Outdated
Comment thread synapse/storage/databases/main/event_federation.py
Comment thread synapse/storage/databases/main/event_federation.py Outdated
Comment thread synapse/storage/databases/main/event_federation.py Outdated
Comment thread synapse/storage/databases/main/event_federation.py Outdated
Comment thread tests/storage/test_event_federation.py Outdated
Comment thread tests/storage/test_event_federation.py
Comment thread tests/storage/test_event_federation.py Outdated
Comment thread synapse/storage/databases/main/event_federation.py
Comment thread changelog.d/19718.misc Outdated
@kegsay
kegsay requested a review from MadLittleMods April 24, 2026 11:53
Comment thread tests/storage/test_event_federation.py
Comment thread synapse/storage/databases/main/event_federation.py
Comment thread tests/storage/test_event_federation.py Outdated
Comment thread synapse/storage/databases/main/event_federation.py
Comment thread tests/storage/test_event_federation.py Outdated
Comment thread tests/storage/test_event_federation.py
Comment thread synapse/storage/databases/main/event_federation.py
Comment thread synapse/storage/databases/main/event_federation.py
Comment thread synapse/storage/databases/main/event_federation.py
Comment thread synapse/storage/databases/main/event_federation.py
Comment thread synapse/storage/databases/main/event_federation.py
@CLAassistant

CLAassistant commented Aug 18, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@kegsay
kegsay requested a review from MadLittleMods August 19, 2026 11:09
@kegsay kegsay mentioned this pull request Aug 21, 2026
3 tasks
Comment thread changelog.d/19718.misc
Comment thread tests/storage/test_event_federation.py
Executes as a single recursive CTE in both SQLite and Postgres.
"""
earliest_set = set(earliest_event_ids)
seed_ids = sorted(set(latest_event_ids) - earliest_set)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Updated to the following

# Sort the seeds lexicographically by event ID: seeds are all 0 hops away from
# themselves, so the event ID is the only tie-breaker available for them and we need
# the walk to start from a deterministic order.
seed_ids = sorted(set(latest_event_ids) - earliest_set)

We should point to MSC4242 that explains this behavior

@kegsay
kegsay force-pushed the kegan/4242-storage branch from 5a708b9 to 64a291f Compare September 1, 2026 14:16
@kegsay
kegsay force-pushed the kegan/4242-storage branch from 64a291f to d847335 Compare September 2, 2026 07:19
@kegsay
kegsay merged commit 54bfa1a into develop Sep 2, 2026
47 checks passed
@kegsay
kegsay deleted the kegan/4242-storage branch September 2, 2026 08:12
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