Skip to content

Commit f5144b8

Browse files
authored
feat: version 2 catalog serialization (#26183)
This introduces a new version for the catalog file formats ([snapshot](https://github.com/influxdata/influxdb/blob/3b57682214a912d8257bfb96d8efb7cb6b6f7e12/influxdb3_catalog/src/snapshot/versions/mod.rs#L2) files and [log](https://github.com/influxdata/influxdb/blob/3b57682214a912d8257bfb96d8efb7cb6b6f7e12/influxdb3_catalog/src/log/versions/mod.rs#L2) files). The reason for introducing a new version is to change the serialization/deserialization format from [`bitcode`](https://docs.rs/bitcode/latest/bitcode/) to JSON. See #26180. The approach taken was to copy the existing type definitions for both log and snapshot files into two places: a `v1` module and a `v2` module. Going forward: * Types defined in `v1` should not be changed. They are only there to enable deserialization of existing bitcode-serialized catalog files. * Types defined in `v2` can be modified in a backward-compatible manor, and new types can be added to the `v2` modules With this PR, old files are not overwritten. The server does not migrate any files on startup. See #26183 (comment) Closes #26180
1 parent f456fd4 commit f5144b8

12 files changed

Lines changed: 3439 additions & 1399 deletions

File tree

influxdb3_catalog/src/log.rs

Lines changed: 2 additions & 788 deletions
Large diffs are not rendered by default.

influxdb3_catalog/src/log/create.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ use std::sync::Arc;
22

33
use influxdb3_id::{ColumnId, DbId, TableId};
44

5+
use crate::catalog::CatalogSequenceNumber;
6+
57
use super::*;
68

79
pub fn catalog_database_batch_op(
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pub(crate) mod v1;
2+
pub(crate) mod v2;

0 commit comments

Comments
 (0)