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

Manage ids across different mappings connected to the same database #21

Closed
spine-o-bot opened this issue Feb 3, 2021 · 7 comments
Closed
Assignees
Labels

Comments

@spine-o-bot
Copy link

In GitLab by @manuelma on Sep 29, 2018, 15:26

There needs to be a way for a DiffDatabaseMapping to reserve ids, so that other processes don't steal them from it. An idea would be to create a table next_id that the DiffDatabaseMapping will keep updated. If the other process finds this table, it'll also use it and update it.

@spine-o-bot
Copy link
Author

In GitLab by @manuelma on Sep 30, 2018, 15:19

assigned to @manuelma

@spine-o-bot
Copy link
Author

In GitLab by @manuelma on Sep 30, 2018, 19:12

mentioned in commit 75a395e

@spine-o-bot
Copy link
Author

In GitLab by @manuelma on Oct 1, 2018, 10:45

The next_id table is in place and works fine. Needs testing. One weakness is ids are incremented before the user commits their changes, so if they rollback instead we 'lose' a lot of ids. Do we care?

@spine-o-bot
Copy link
Author

In GitLab by @jkiviluo on Oct 2, 2018, 10:30

You mean there will be id numbers that have been skipped over and will not be used in the DB anymore? I wouldn't care as long as the max id is substantial.

@spine-o-bot
Copy link
Author

In GitLab by @manuelma on Oct 2, 2018, 10:48

Apparently the max in SQLite is 2^64, that is 1.84e19. So we have some room but also we can implement some logic so as not to skip ids.

@spine-o-bot
Copy link
Author

In GitLab by @jkiviluo on Oct 2, 2018, 14:54

In my opinion that's substantial. :)

@spine-o-bot
Copy link
Author

In GitLab by @manuelma on Jan 24, 2019, 16:07

This is done but needs unittesting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants