Skip to content

Conversation

@ChrisPenner
Copy link
Member

@ChrisPenner ChrisPenner commented Feb 26, 2025

  • Create Depth Tables on Prod
  • Create and initialize migration tables on Prod.
  • Sanity Check Prod after migration

Overview

Iteratively track dependency-depth information for all entities such that we can stream entities to UCM clients in dependency-first order which allows them to save entities as soon as they're received rather than needing to do a client-side sort.

This also reduces required memory usage on the client, and makes the download more robust against Ctrl-c, since you can pick up from where you left off (the stream will skip any pre-saved entities).

Implementation notes

When an entity is saved, set its depth to max(depth of all dependencies) + 1.
When streaming entities to client, sort by depth ASC.
Set sort mode of stream to Dependencies First.

Test coverage

  • Test on staging

Loose ends

There's a corresponding improvement in UCM to better parallelize the download stream here: unisonweb/unison#5593

@ChrisPenner ChrisPenner force-pushed the syncv2/depth-sort branch 2 times, most recently from b60d74d to 6a6dfe1 Compare March 7, 2025 00:35
@ChrisPenner ChrisPenner marked this pull request as ready for review March 10, 2025 18:06
@ChrisPenner ChrisPenner merged commit 0f7e91d into main Mar 10, 2025
4 checks passed
@ChrisPenner ChrisPenner deleted the syncv2/depth-sort branch March 10, 2025 18:06
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