Skip to content

Commit

Permalink
feat(meta-rewrite): meta data upgrade program
Browse files Browse the repository at this point in the history
**What it does**:

This program load meta-service data from a `raft-dir` and upgrade TableMeta to new version and write them back.

Both in raft-log data and in state-machine data will be converted.

Usage:

- Shut down databend-meta
- Backup the data: https://databend.rs/doc/deploy/metasrv/metasrv-backup-restore
- Build it with `cargo build --bin databend-meta-upgrade-2023-01-15` and run it:

```text
databend-meta-upgrade-2023-01-15 --cmd upgrade --raft-dir "<./your/raft-dir/>"
```
  • Loading branch information
drmingdrmer committed Jan 16, 2023
1 parent 1ddbaf3 commit 165a56e
Show file tree
Hide file tree
Showing 15 changed files with 799 additions and 14 deletions.
21 changes: 21 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ edition = "2021"
members = [
# Binaries
"src/binaries",
"src/binaries/meta-upgrade-2023-01-15",
# Common
"src/common/arrow",
"src/common/auth",
Expand Down
34 changes: 34 additions & 0 deletions src/binaries/meta-upgrade-2023-01-15/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[package]
name = "databend-meta-upgrade-2022-01-15"
description = "upgrade meta-service data to VER=24"
version = { workspace = true }
authors = { workspace = true }
license = { workspace = true }
publish = { workspace = true }
edition = { workspace = true }

[dependencies]
# Workspace dependencies
common-meta-api = { path = "../../meta/api" }
common-meta-app = { path = "../../meta/app" }
common-meta-raft-store = { path = "../../meta/raft-store" }
common-meta-sled-store = { path = "../../meta/sled-store" }
common-meta-types = { path = "../../meta/types" }
common-proto-conv = { path = "../../meta/proto-conv" }
common-protos = { path = "../../meta/protos" }
common-tracing = { path = "../../common/tracing" }

# Crates.io dependencies
anyhow = { workspace = true }
clap = { workspace = true }
openraft = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
tokio = { version = "1.21.1", features = ["full"] }
tracing = "0.1.36"

[[bin]]
name = "databend-meta-upgrade-2023-01-15"
path = "src/main.rs"
doctest = false
test = false
Loading

0 comments on commit 165a56e

Please sign in to comment.