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

feat: Add u32 ID for Databases #25302

Merged
merged 2 commits into from
Sep 18, 2024
Merged

feat: Add u32 ID for Databases #25302

merged 2 commits into from
Sep 18, 2024

Conversation

mgattozzi
Copy link
Contributor

@mgattozzi mgattozzi commented Sep 10, 2024

This commit adds a new DbId for databases. It also updates paths to use that id as part of the name. When starting up the WriteBuffer we apply the DbId from the persisted snapshot much like we do for ParquetFileId's

This introduces the influxdb3_id crate to avoid circular deps with ids. The ParquetFileId should also be moved into this crate, but it's outside the scope of this change.

Closes #25301

Copy link
Contributor

@hiltontj hiltontj left a comment

Choose a reason for hiding this comment

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

I think it would be good to add a test that shows something like the following:

  • Start a new server then create 1 or more databases
  • Restart the server
  • Create another database, and assert that it uses the next ID, i.e., it doesn't start from 0 again

That may be doable at a lower level than the server, e.g., with the persister, or with the catalog directly, but its not clear to me that it does this. Otherwise things look good!

Cargo.toml Outdated Show resolved Hide resolved
Since we now are using cargo-nextest in CI we can remove
the locks used in the FileId tests to make sure that we
have no race conditions
This commit adds a new DbId for databases. It also updates paths to use
that id as part of the name. When starting up the WriteBuffer we apply
the DbId from the persisted snapshot much like we do for ParquetFileId's

This introduces the influxdb3_id crate to avoid circular deps with ids.
The ParquetFileId should also be moved into this crate, but it's
outside the scope of this change.

Closes #25301
@mgattozzi mgattozzi merged commit 54d209d into main Sep 18, 2024
12 checks passed
@mgattozzi mgattozzi deleted the mgattozzi/u32-db branch September 18, 2024 15:44
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.

Add uint32 ID to Database in the Catalog
2 participants