Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache durable frame number per sync URL #1837

Open
penberg opened this issue Nov 22, 2024 · 0 comments · May be fixed by #1908
Open

Cache durable frame number per sync URL #1837

penberg opened this issue Nov 22, 2024 · 0 comments · May be fixed by #1908
Assignees
Labels
enhancement New feature or request offline writes

Comments

@penberg
Copy link
Collaborator

penberg commented Nov 22, 2024

You can sync a local database to multiple remote databases. Therefore, cache durable frame number per sync URL, not per local database.

@LucioFranco LucioFranco self-assigned this Jan 7, 2025
LucioFranco added a commit that referenced this issue Jan 7, 2025
This commit changes the filename of the metadata file to contain
`<db_path>-<sync_url>-info`. Where `db_path` is a full file path +
filename and `sync_url` is the host of the authority of the URI. This
also includes upfront uri parsing and two new errors that can be
produced when trying to extract the host.

This approach trades off creating multiple files in exchange for
allowing multiple sync context's to operate at the same time
concurrently. Originally, I had approached updating the metadata to
include a hashmap of endpoints and their metadata but this approach
falls flat if you have multiple `Database` and thus `SyncContext` in the
same process (and beyond).

This commit does NOT include updating from the original v0 metadata
format but instead will force a full re-sync and a new meatadata file
will be produced with verison set to `1`. Not implementing this mean't
simpler code with less space to produce errors and since this only runs
once when a user upgrades that cost is okay.

Closes #1837
@LucioFranco LucioFranco linked a pull request Jan 7, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request offline writes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants