Skip to content

Conversation

@rescrv
Copy link
Contributor

@rescrv rescrv commented Dec 29, 2025

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

@github-actions
Copy link

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

@propel-code-bot
Copy link
Contributor

propel-code-bot bot commented Dec 29, 2025

Introduce Spanner schema for Rust log service

Adds the initial Cloud Spanner schema for the Rust log service, covering manifests, fragments, and fragment regions. Updates the migration manifest sums so the new migration set is tracked with running SHA checksums and refreshed CLI regeneration instructions.

Key Changes

• Create manifests, fragments, and fragment_regions tables with primary keys scoped by log_id
• Interleave fragments under manifests and fragment_regions under fragments to collocate hierarchical rows
• Regenerate rust/spanner-migrations/log_migrations/log_migrations.sum to include the new files and adjust checksum annotations

Affected Areas

• rust/spanner-migrations/log_migrations
• rust/spanner-migrations/migrations

This summary was automatically generated by @propel-code-bot

@rescrv rescrv requested a review from sanketkedia December 30, 2025 16:45
@rescrv rescrv force-pushed the rescrv/quorum-writer branch from a57a27d to af49672 Compare December 30, 2025 21:53
@rescrv rescrv force-pushed the rescrv/log-db-schema branch from 4c34c40 to a809fdb Compare December 30, 2025 21:54
@rescrv rescrv force-pushed the rescrv/quorum-writer branch from af49672 to 5ba021d Compare December 30, 2025 23:09
@rescrv rescrv force-pushed the rescrv/log-db-schema branch from a809fdb to 46ebbf2 Compare December 30, 2025 23:10
@rescrv rescrv force-pushed the rescrv/quorum-writer branch from 5ba021d to d1d3137 Compare December 31, 2025 00:10
@rescrv rescrv force-pushed the rescrv/log-db-schema branch from 46ebbf2 to 4c8c8e1 Compare December 31, 2025 00:11
@rescrv rescrv force-pushed the rescrv/quorum-writer branch from d1d3137 to ed229e0 Compare December 31, 2025 01:05
@rescrv rescrv force-pushed the rescrv/log-db-schema branch from d1e28ae to 742a707 Compare December 31, 2025 01:06
@rescrv rescrv force-pushed the rescrv/quorum-writer branch from ed229e0 to 2f00206 Compare January 2, 2026 23:12
@rescrv rescrv force-pushed the rescrv/log-db-schema branch from 049c984 to 9f4eecc Compare January 2, 2026 23:13
collected STRING(64) NOT NULL,
acc_bytes INT64 NOT NULL,
writer STRING(64) NOT NULL,
enumeration_offset INT64 NOT NULL
Copy link
Contributor

@sanketkedia sanketkedia Jan 2, 2026

Choose a reason for hiding this comment

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

I thought you were not in favor of keeping an explicit enumeration_offset since it incurs an update to this table for every write?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This design is the one we benchmarked most recently. The alternative is to do a query across all fragments which is worse.

@rescrv rescrv force-pushed the rescrv/quorum-writer branch from 2f00206 to 06ee7ec Compare January 6, 2026 18:16
@rescrv rescrv force-pushed the rescrv/log-db-schema branch from 62532d6 to e4ea26a Compare January 7, 2026 22:31
CREATE TABLE IF NOT EXISTS fragments (
log_id STRING(36) NOT NULL,
ident STRING(36) NOT NULL,
path STRING(64) NOT NULL,
Copy link
Contributor

Choose a reason for hiding this comment

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

Critical

[Logic] The path column length of 64 characters is insufficient for the paths generated by wal3.

In rust/wal3/src/lib.rs, unprefixed_fragment_path generates paths like:
log/Bucket={:016x}/FragmentSeqNo={:016x}.parquet

Counting the characters:

  • log/ (4)
  • Bucket= (7)
  • 16 hex digits (16)
  • / (1)
  • FragmentSeqNo= (14)
  • 16 hex digits (16)
  • .parquet (8)

Total = 66 characters. This exceeds the STRING(64) limit and will cause insertion failures for SeqNo-based fragments.

Increase the column size to at least 128 to be safe.

Context for Agents
The `path` column length of 64 characters is insufficient for the paths generated by `wal3`.

In `rust/wal3/src/lib.rs`, `unprefixed_fragment_path` generates paths like:
`log/Bucket={:016x}/FragmentSeqNo={:016x}.parquet`

Counting the characters:
- `log/` (4)
- `Bucket=` (7)
- 16 hex digits (16)
- `/` (1)
- `FragmentSeqNo=` (14)
- 16 hex digits (16)
- `.parquet` (8)

Total = 66 characters. This exceeds the `STRING(64)` limit and will cause insertion failures for SeqNo-based fragments.

Increase the column size to at least 128 to be safe.

File: rust/spanner-migrations/log_migrations/0002-create_fragments_table.spanner.sql
Line: 4

Copy link
Contributor Author

Choose a reason for hiding this comment

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

UUID-based fragments don't have the added chars

@rescrv rescrv changed the base branch from rescrv/quorum-writer to main January 7, 2026 23:02
@rescrv rescrv changed the base branch from main to rescrv/logdb-spanner January 7, 2026 23:03
Base automatically changed from rescrv/logdb-spanner to main January 8, 2026 19:55
@rescrv rescrv force-pushed the rescrv/log-db-schema branch from e4ea26a to ef9b07f Compare January 8, 2026 19:57
@rescrv rescrv merged commit aa1ea6f into main Jan 8, 2026
64 checks passed
@rescrv rescrv deleted the rescrv/log-db-schema branch January 8, 2026 20:47
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.

3 participants