Skip to content

Remove the FoundationDB consensus and timestamp oracle backends - #38706

Merged
antiguru merged 1 commit into
mainfrom
claude/remove-fdb-code-r00dp7
Sep 8, 2026
Merged

Remove the FoundationDB consensus and timestamp oracle backends#38706
antiguru merged 1 commit into
mainfrom
claude/remove-fdb-code-r00dp7

Conversation

@antiguru

@antiguru antiguru commented Sep 7, 2026

Copy link
Copy Markdown
Member

FoundationDB was wired in behind a foundationdb cargo feature as an alternative persist consensus and timestamp oracle backend, with a supporting mz-foundationdb crate, an mzcompose server image, CI jobs, and a libfdb_c.so copy in all three production base images.

Nothing depends on it, and linking the FoundationDB C client into testdrive, environmentd and clusterd carries a teardown hazard: the contract in mz-foundationdb requires dropping every Database and transaction handle and then calling shutdown_network() before exit, but the NetworkAutoStop guard lived in a static that Rust never drops, so fdb_stop_network never ran and the C network thread outlived Rust teardown. That surfaced as glibc heap corruption aborting testdrive at process exit.

Removing the backends drops the hazard along with the maintenance cost of the client pin, which was coupled across three Dockerfiles, a Homebrew cross-compilation formula, and the crate's API feature.

Description

Deleted: the mz-foundationdb crate, FdbConsensus, FdbTimestampOracle, the test/foundationdb composition and server image, the mzcompose FoundationDB service, doc/developer/foundationdb.md, and the -foundationdb dependency-lint ground truth files.

Unwired: the foundationdb feature from persist, persist-client, timestamp-oracle, adapter, clusterd, environmentd, materialized and testdrive; the workspace member and the foundationdb workspace dependency; the ConsensusConfig::FoundationDB and TimestampOracleConfig::Fdb variants and their URL schemes; the libfdb_c.so COPY from the three prod base images; the client .deb from the CI builder; the libfdb-c-* Homebrew formula from xcompile.py; the nightly testdrive-fdb and fdb pipeline steps; the FDB service and cluster-file plumbing in the cargo-test composition; bin/run --foundationdb; and the nextest retry overrides for the FDB unit tests.

futures-util is dropped from mz-timestamp-oracle along with its unused-deps ignore, since only the FDB oracle used it. Cargo.lock loses only the foundationdb* crates and their exclusive transitive dependencies, with no version changes elsewhere.

doc/developer/design/20220404_metadata_storage.md still mentions FoundationDB as an option weighed at the time; it is left as the historical record it is.

Verification

cargo check --workspace, bin/fmt --check and bin/lint-cargo pass. No tests were added or modified; the FDB-specific unit tests are removed with the code they covered.

Closes: PER-82

🤖 Generated with Claude Code

https://claude.ai/code/session_01ETNBVh4CrGA53FJTNS9m4v


Generated by Claude Code

FoundationDB was wired in behind a `foundationdb` cargo feature as an
alternative persist consensus and timestamp oracle backend, with a
supporting `mz-foundationdb` crate, an mzcompose server image, CI jobs,
and a `libfdb_c.so` copy in all three production base images.

Nothing depends on it, and linking the FoundationDB C client into
testdrive, environmentd and clusterd carries a teardown hazard: the
contract in `mz-foundationdb` requires dropping every `Database` and
transaction handle and then calling `shutdown_network()` before exit, but
the `NetworkAutoStop` guard lived in a `static` that Rust never drops, so
`fdb_stop_network` never ran and the C network thread outlived Rust
teardown. That surfaced as glibc heap corruption aborting testdrive at
process exit.

Removing the backends drops the hazard along with the maintenance cost of
the client pin, which was coupled across three Dockerfiles, a Homebrew
cross-compilation formula, and the crate's API feature.

Closes: PER-82

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ETNBVh4CrGA53FJTNS9m4v
@antiguru
antiguru requested review from a team as code owners September 7, 2026 19:35
@linear-code

linear-code Bot commented Sep 7, 2026

Copy link
Copy Markdown

PER-82

antiguru commented Sep 7, 2026

Copy link
Copy Markdown
Member Author

buildkite/test/checks-parallel-2 failed (build 133929). I can't read the job log from my environment (no Buildkite CLI, MCP, or dashboard token), so I have not identified the error itself, and I have no means to re-run the job.

Evidence that it is not this PR's:

  • That job is checks-no-restart-no-upgrade, which runs with --no-external-metadata-store. Every line this PR removed from materialized.py sits inside if external_metadata_store:, so it is not on that job's path.
  • Dumping Materialized(...).config and Testdrive(...).config from this branch and from origin/main, for external_metadata_store in False/True/"toxiproxy", gives byte-identical output modulo the tree path. The generated composition does not change.
  • The rebuilt materialized image is healthy on this commit: mysql-rtr and postgres-rtr use the same image and passed, which rules out the one runtime-visible change here (dropping libfdb_c.so and the foundationdb feature from the image).
  • The job runs --execution-mode=parallel with --seed=$BUILDKITE_JOB_ID, so it is randomized per run.

No fix exists to port. Someone with Buildkite access should check the annotation; if it names a real regression I'll take it.


Generated by Claude Code

@ggevay ggevay left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@antiguru

antiguru commented Sep 8, 2026

Copy link
Copy Markdown
Member Author

Read the annotation now that I have Buildkite access. The failure is SS-415, open and labelled Test Blocker:

thread 'timely:work-0' panicked at src/storage/src/storage_state.rs:1084:30:
only alter compatible exports permitted: AlterError { id: User(23) }

That panic killed materialized, so the coordinator and catalog consistency checks then failed with DNS errors against a dead container. Those are the cascade, not the cause.

SS-415's own description already lists build 133929 among its occurrences, alongside five other unrelated branches in the past week. The panic is in src/storage, which this PR does not touch, and the job passed on its last five main runs.

Retried the job once: Checks parallel 2.


Generated by Claude Code

@antiguru
antiguru enabled auto-merge (squash) September 8, 2026 16:52
@antiguru
antiguru disabled auto-merge September 8, 2026 16:52
@antiguru
antiguru enabled auto-merge (squash) September 8, 2026 16:53
@antiguru
antiguru merged commit a054d68 into main Sep 8, 2026
101 checks passed
@antiguru
antiguru deleted the claude/remove-fdb-code-r00dp7 branch September 8, 2026 16:55
@antiguru

antiguru commented Sep 8, 2026

Copy link
Copy Markdown
Member Author

Thanks for the reviews!

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.

5 participants