Skip to content

Commit aa1ea6f

Browse files
authored
[ENH] Add the schema for Rust Log Service in Spanner. (#6096)
## Description of changes This PR is the schema for the replicated log. ## Test plan CI ## Migration plan N/A ## Observability plan N/A ## Documentation Changes N/A
1 parent fb75fb5 commit aa1ea6f

5 files changed

Lines changed: 31 additions & 3 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CREATE TABLE IF NOT EXISTS manifests (
2+
log_id STRING(36) NOT NULL,
3+
setsum STRING(64) NOT NULL,
4+
collected STRING(64) NOT NULL,
5+
acc_bytes INT64 NOT NULL,
6+
writer STRING(64) NOT NULL,
7+
enumeration_offset INT64 NOT NULL
8+
) PRIMARY KEY (log_id);
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CREATE TABLE IF NOT EXISTS fragments (
2+
log_id STRING(36) NOT NULL,
3+
ident STRING(36) NOT NULL,
4+
path STRING(64) NOT NULL,
5+
position_start INT64 NOT NULL,
6+
position_limit INT64 NOT NULL,
7+
num_bytes INT64 NOT NULL,
8+
setsum STRING(64) NOT NULL
9+
) PRIMARY KEY (log_id, ident),
10+
INTERLEAVE IN PARENT manifests ON DELETE NO ACTION;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
CREATE TABLE IF NOT EXISTS fragment_regions (
2+
log_id STRING(36) NOT NULL,
3+
ident STRING(36) NOT NULL,
4+
region STRING(32) NOT NULL
5+
) PRIMARY KEY (log_id, ident, region),
6+
INTERLEAVE IN PARENT fragments ON DELETE NO ACTION;
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# Spanner migrations manifest - DO NOT EDIT MANUALLY
2-
# Format: {filename} {sha256_hash}
2+
# Format: {filename} {running_sha256_hash}
33
# This file protects against merge conflicts and forgotten migration files.
4-
# Run `cargo run --bin spanner_migration -- --generate-sum` to regenerate.
4+
# Run `cargo run --bin spanner_migration -- generate-sum` to regenerate.
5+
6+
0001-create_manifests_table.spanner.sql f035d1216ff440fbf43c6337039143b6de805c91a01ae25b6440b329381eaf5a
7+
0002-create_fragments_table.spanner.sql 1867b6d5b9189b59a9ca83faeafe337883924315b50d5302c2058534fabe6d55
8+
0003-create_fragment_regions_table.spanner.sql dbc683e9c0b7ac9295e233beec807998b1b0dc274185c5c40585af088221d4f0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Spanner migrations manifest - DO NOT EDIT MANUALLY
22
# Format: {filename} {running_sha256_hash}
33
# This file protects against merge conflicts and forgotten migration files.
4-
# Run `cargo run --bin spanner_migration -- --generate-sum` to regenerate.
4+
# Run `cargo run --bin spanner_migration -- generate-sum` to regenerate.
55

66
0001-create_tenants.spanner.sql 87dbaa652753aba0730b9b784a2974f0b23c2017b562ec9f0b01663d9c840321
77
0002-create_databases.spanner.sql e07d1f1b3d7c9ac2d7df289b7da4b46602c350a3b7589444cde87ece30db4fa8

0 commit comments

Comments
 (0)