Skip to content

fix(storage): refuse a damaged encryption key at startup - #863

Closed
LeeroyHannigan wants to merge 8 commits into
mainfrom
fix/refuse-damaged-encryption-key
Closed

LeeroyHannigan wants to merge 8 commits into
mainfrom
fix/refuse-damaged-encryption-key

Conversation

@LeeroyHannigan

@LeeroyHannigan LeeroyHannigan commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

What

  • Each storage backend now refuses to start when the secret cipher refuses the catalog encryption key. The cipher refuses a key that is not base64, or that does not decode to 32 bytes. serve stops with BackendError::InvalidEncryptionKey and the reason from the cipher. Each extenddb backup command opens the catalog through the same factories, so it refuses the key too. Before this change, only a missing key stopped them.
  • server_components::check_encryption_key runs secret_cipher::cipher_key, the decode and length check of encrypt_secret and decrypt_secret, and maps its error to the new variant. The SQLite, PostgreSQL, MongoDB and Cassandra factories call it after the check for a missing key.
  • The comment on the MongoDB key load now describes both checks.
  • ADR-0026 now says that the MongoDB driver builds its TLS client configuration with rustls::crypto::ring. The decision does not change.
  • Step 1 of the manual key rotation in the security model, from docs: state the catalog trust boundary for the credential encryption key #228, said that the server checks only that the key is present. It now says that the server and each extenddb backup command refuse a key that is not 32 bytes in standard base64.
  • The troubleshooting entry for Management API: encrypt session secret failed gave a damaged key as a cause. The server now checks the key at startup, so the entry says that the key is not the cause.
  • A PostgreSQL test from main wrote test-key as the encryption key, which the new check refuses. The test now writes a key from generate_encryption_key.

Why

@robinnsc found on #776 that with a 16-byte key the server started and /health reported healthy, but every signed request failed with a 500. The credential store could not decrypt any stored secret. A key with a trailing newline from a hand edit fails in the same way, because it is not base64. The check moves that failure to startup and names the cause.

The ADR said that ExtendDB does not use ring as its TLS provider. With its default rustls-tls feature, mongodb 3.8.0 builds its client configuration with ring, so the connections of the MongoDB backend to MongoDB use ring. #858 tracks a move of the driver to rustls-tls-aws-lc. docs/adr/README.md changes an accepted ADR only in its status. This change corrects two statements of fact in ADR-0026 and keeps its decision, as #421 did for ADR-0022. A review comment on #776 asked for the correction.

Refs #776

Testing done

The local runs below used Rust 1.97.0 on d324fa5, unless a line names another commit.

  • cargo test -p extenddb-storage --lib: 261 passed. The tests check that the cipher refuses a key that is not 32 bytes, or that is not base64, with its reason. They also check the message of the new error, and that the message has no doubled period after a reason that ends with one.
  • cargo test -p extenddb-storage-sqlite --lib: 299 passed, 2 failed, 1 ignored. The new serve test starts the SQLite factory on a catalog whose key has a trailing newline. It checks the refusal and its reason, then starts the catalog with a 32-byte key. Without the SQLite call, the earlier form of this test failed because the server started. The 2 failures are the backup_catalog::write_lock_tests tests. On the test host, another user owns a directory above their backup root, so the filesystem store refuses that root.
  • On 6e37e07, the merge of main: cargo test --lib for the PostgreSQL (78 passed), MongoDB (172 passed, 73 ignored) and Cassandra (139 passed) backends. Of those crates, the later commits change only crates/storage-postgres/tests/backup_restore.rs. The other integration tests of those backends need a database, and CI runs them.
  • catalog_index::components_opened_beside_a_server_apply_no_pending_index_write, against a local PostgreSQL 16 server: it passes with the generated key. With test-key it fails with InvalidEncryptionKey.
  • cargo +1.97.0 clippy --all-targets -- -D warnings on extenddb-storage and extenddb-storage-sqlite, and cargo +1.97.0 fmt --all -- --check. On 6e37e07, clippy also ran on the other three backend crates.
  • CI on 7f41d61, before the latest commits: all 58 checks passed.

Checklist

  • I have read CONTRIBUTING.md
  • All tests pass (cargo test --workspace)
  • Code is formatted (cargo fmt --check)
  • Clippy is clean (cargo clippy -- -W clippy::pedantic)
  • I have added or updated tests for new functionality
  • I have updated documentation if behavior changed
  • Breaking changes are noted below (if any)
  • If this changes the wire protocol, Storage trait, auth model, on-disk
    format, or public CLI surface, an RFC has been accepted or is linked
    below. Otherwise, an ADR captures the decision (link below).

CI runs the workspace tests. Clippy ran with -D warnings, without the pedantic group.

ADR / RFC: ADR-0026, corrected

Breaking changes

A catalog with an encryption key that is not base64, or that does not decode to 32 bytes, now stops serve at startup. Each extenddb backup command refuses to run on it too. Before this change, the server started and failed each signed request with a 500. The key that init writes passes the check.


By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache License 2.0 and I agree to the Developer Certificate of
Origin (DCO). See CONTRIBUTING.md for details.

Each backend refused to start when the catalog had no encryption key,
but it started with a key that the secret cipher refuses: a key that is
not base64, or that does not decode to 32 bytes. The credential store
then failed to decrypt every stored secret, so each signed request got
a 500 and the log named the key error.

secret_cipher::check_key runs the decode and length check that
encrypt_secret and decrypt_secret run. check_encryption_key in
server_components maps its error to the new
BackendError::InvalidEncryptionKey. The SQLite, PostgreSQL, MongoDB and
Cassandra factories call it on the key they load, after the check for a
missing key, so serve stops with the reason the cipher gives. A key
with a trailing newline from a hand edit is not base64, and the check
refuses it in the same way.

The comment on the MongoDB key load read as if a key of the wrong
length was refused at startup, when only a missing key was. It now
describes both checks.

Tests: check_key accepts and refuses the same keys as encrypt_secret,
with the same error. A SQLite catalog with a 16-byte key, or with a
32-byte key and a trailing newline, refuses to start and names the
reason. The same catalog starts again with a 32-byte key. With the
SQLite call removed, that test fails because the server starts.
ADR-0026 said that ExtendDB installs the rustls aws-lc-rs provider for
its TLS server and clients, and that ExtendDB does not use ring as its
TLS provider. The MongoDB driver does not use the installed provider.
With its default rustls-tls feature, mongodb 3.8.0 builds its client
configuration with rustls::crypto::ring, so the MongoDB backend's
connections to MongoDB run on ring. This is why the MongoDB build links
ring.

The Context section now names that exception, and option 3 says what
ring is linked for. The decision does not change.
On main, the SQLite factory loads the encryption key in components_of.
The merge calls check_encryption_key right after that load, as the
branch did in the old factory.
components_opened_beside_a_server_apply_no_pending_index_write came from
main with the merge. It wrote 'test-key' as the encryption key. The
startup check refuses a value that does not decode to 32 bytes, with
"InvalidEncryptionKey: decode encryption key: Invalid symbol 45, offset
4". The test now writes a key from generate_encryption_key, as the
Cassandra access key tests do.
Step 1 of the manual key rotation said that the server checks only that
the key is present. It said that a value of any other form makes every
signed request fail. check_encryption_key refuses such a value at
startup. The step now says that the server refuses to start.
The base64 decoder ends its invalid-symbol text with a period, so the
error read "offset 44.. Restore the original key". The message now
trims the trailing period from the reason.

check_encryption_key calls cipher_key, which encrypt_secret and
decrypt_secret already call, in place of a one-line public wrapper.
Four tests pinned the same 16-byte refusal. The cipher keeps its data
table of refused keys, server_components keeps one check of the
message, and the SQLite serve test keeps one refused key.
Each extenddb backup command opens the catalog through the factory
that checks the key, so it refuses an invalid key as the server does.
Step 1 of the manual rotation in the security model now names both.

The troubleshooting entry for a failed encryption of a session secret
gave a damaged key as a cause. The server checks the key at startup
and encrypts with the copy it loaded then. The entry now says that the
key is not the cause.
@LeeroyHannigan

Copy link
Copy Markdown
Collaborator Author

#1003 carries these commits. It implements RFC-0000 for #707, whose startup loader runs this key check before it reads the key ring, so the two cannot land apart. Closing here. The change and its tests are in #1003.

LeeroyHannigan added a commit that referenced this pull request Nov 16, 2026
This change implements RFC-0000 for #707. The server can keep the key
that encrypts stored secrets outside the catalog, and it holds less
key material in memory.

- [auth.encryption] key_file names a key-encryption key (KEK) file.
  The KEK wraps a data encryption key (DEK), and the catalog holds the
  wrapped DEK in an encryption_key_ring settings row. The DEK encrypts
  the secret of each access key and each AssumeRole session. On
  PostgreSQL it also encrypts the data_database_connection_string row.
- The server refuses a KEK file that another user can read or replace.
  It checks the canonical path, each parent directory, the open
  descriptor and, on Linux, the POSIX ACL.
- The additional authenticated data (AAD) of AES-GCM binds each stored
  secret to its row, and each wrapped DEK to every field of the ring.
- The credential cache holds one SigV4 signing key per access key and
  scope date, and the SHA-256 of each session token. It holds no
  plaintext secret or token.
- A locked key store holds the DEK or the catalog key, and the signing
  keys. It uses memfd_secret where the kernel has it, and otherwise
  mlock with MADV_DONTDUMP and MADV_WIPEONFORK.
- extenddb encryption-key has six commands: status, switch, rewrap,
  rotate, reset and set-data-connection. rewrap changes the KEK while
  the server runs. switch, rotate and reset run while every server is
  stopped, under the migration lock.
- At startup the server refuses a catalog whose key state does not
  match its configuration. The message names the command or the
  restore that fixes it.
- From #863: each backend and each extenddb backup command refuses a
  catalog key that is not base64 or does not decode to 32 bytes.
  ADR-0026 records that the MongoDB driver builds its TLS
  configuration with rustls::crypto::ring.

Without key_file, the stored format and the catalog key stay as they
are. The catalog key and the signing keys move into the locked key
store. When locking fails, the server logs a warning and starts.

The docs cover the KEK file, its delivery routes, the commands,
rollback, restore and a troubleshooting entry for each refusal.

Closes #707
Refs #776
LeeroyHannigan added a commit that referenced this pull request Nov 17, 2026
This change implements RFC-0000 for #707. The server can keep the key
that encrypts stored secrets outside the catalog, and it holds less
key material in memory.

- [auth.encryption] key_file names a key-encryption key (KEK) file by
  an absolute path. The KEK wraps a data encryption key (DEK), and the
  catalog holds the wrapped DEK in an encryption_key_ring settings row.
  The DEK encrypts the secret of each access key and each AssumeRole
  session. On PostgreSQL it also encrypts the
  data_database_connection_string row.
- The server refuses a KEK file that another user can read or replace.
  It checks the canonical path, each parent directory, the open
  descriptor and, on Linux, the POSIX ACL. It accepts group access
  only on a file that root owns.
- The additional authenticated data (AAD) of AES-GCM binds each stored
  secret to its row, and each wrapped DEK to every field of the ring.
- The credential cache holds one SigV4 signing key per access key and
  scope date, and the SHA-256 of each session token. It holds no
  plaintext secret or token. A key for a new scope date comes with the
  identity of the read that derives it.
- A locked key store holds the DEK or the catalog key, and the signing
  keys. It uses memfd_secret where the kernel has it, and otherwise
  mlock with MADV_DONTDUMP and MADV_WIPEONFORK.
- extenddb encryption-key has six commands: status, switch, rewrap,
  rotate, reset and set-data-connection. rewrap changes the KEK while
  the server runs. switch, rotate and reset run while every server is
  stopped, under the migration lock. rewrap and rotate write the ring
  only while its row holds the ring they read.
- On Cassandra the commands read and write the key rows at ALL. On
  SQLite, switch, rotate and reset end with a VACUUM under
  secure_delete, so no free page keeps a ciphertext they replaced.
- At startup the server refuses a catalog whose key state does not
  match its configuration. The message names the command or the
  restore that fixes it.
- From #863: each backend and each extenddb backup command refuses a
  catalog key that is not base64 or does not decode to 32 bytes.
  ADR-0026 records that the MongoDB driver builds its TLS
  configuration with rustls::crypto::ring.

Without key_file, the stored format and the catalog key stay as they
are. The catalog key and the signing keys move into the locked key
store. When locking fails, the server logs a warning and starts.

The docs cover the KEK file, its delivery routes, the commands,
rollback, restore and a troubleshooting entry for each refusal.

Closes #707
Refs #776
LeeroyHannigan added a commit that referenced this pull request Nov 17, 2026
This change implements RFC-0000 for #707. The server can keep the key
that encrypts stored secrets outside the catalog, and it holds less
key material in memory.

- [auth.encryption] key_file names a key-encryption key (KEK) file by
  an absolute path. The KEK wraps a data encryption key (DEK), and the
  catalog holds the wrapped DEK in an encryption_key_ring settings row.
  The DEK encrypts the secret of each access key and each AssumeRole
  session. On PostgreSQL it also encrypts the
  data_database_connection_string row.
- The server refuses a KEK file that another user can read or replace.
  It checks the canonical path, each parent directory, the open
  descriptor and, on Linux, the POSIX ACL. It accepts group access
  only on a file that root owns.
- The additional authenticated data (AAD) of AES-GCM binds each stored
  secret to its row, and each wrapped DEK to every field of the ring.
- The credential cache holds one SigV4 signing key per access key and
  scope date, and the SHA-256 of each session token. It holds no
  plaintext secret or token. A key for a new scope date comes with the
  identity of the read that derives it.
- A locked key store holds the DEK or the catalog key, and the signing
  keys. It uses memfd_secret where the kernel has it, and otherwise
  mlock with MADV_DONTDUMP and MADV_WIPEONFORK.
- extenddb encryption-key has six commands: status, switch, rewrap,
  rotate, reset and set-data-connection. rewrap changes the KEK while
  the server runs. switch, rotate and reset run while every server is
  stopped, under the migration lock. rewrap, rotate and reset write the
  ring only while its row holds the ring they read.
- On Cassandra the commands read and write the key rows at ALL. On
  SQLite, switch, rotate and reset end with a VACUUM under
  secure_delete, so no free page keeps a ciphertext they replaced.
- At startup the server refuses a catalog whose key state does not
  match its configuration. The message names the command or the
  restore that fixes it.
- From #863: each backend and each extenddb backup command refuses a
  catalog key that is not base64 or does not decode to 32 bytes.
  ADR-0026 records that the MongoDB driver builds its TLS
  configuration with rustls::crypto::ring.

Without key_file, the stored format and the catalog key stay as they
are. The catalog key and the signing keys move into the locked key
store. When locking fails, the server logs a warning and starts.

The docs cover the KEK file, its delivery routes, the commands,
rollback, restore and a troubleshooting entry for each refusal.

Closes #707
Refs #776
LeeroyHannigan added a commit that referenced this pull request Nov 17, 2026
This change implements RFC-0000 for #707. The server can keep the key
that encrypts stored secrets outside the catalog, and it holds less
key material in memory.

- [auth.encryption] key_file names a key-encryption key (KEK) file by
  an absolute path. The KEK wraps a data encryption key (DEK), and the
  catalog holds the wrapped DEK in an encryption_key_ring settings row.
  The DEK encrypts the secret of each access key and each AssumeRole
  session. On PostgreSQL it also encrypts the
  data_database_connection_string row.
- The server refuses a KEK file that another user can read or replace.
  It checks the canonical path, each parent directory, the open
  descriptor and, on Linux, the POSIX ACL. It accepts group access
  only on a file that root owns.
- The additional authenticated data (AAD) of AES-GCM binds each stored
  secret to its row, and each wrapped DEK to every field of the ring.
- The credential cache holds one SigV4 signing key per access key and
  scope date, and the SHA-256 of each session token. It holds no
  plaintext secret or token. A key for a new scope date comes with the
  identity of the read that derives it.
- A locked key store holds the DEK or the catalog key, and the signing
  keys. It uses memfd_secret where the kernel has it, and otherwise
  mlock with MADV_DONTDUMP and MADV_WIPEONFORK.
- extenddb encryption-key has six commands: status, switch, rewrap,
  rotate, reset and set-data-connection. rewrap changes the KEK while
  the server runs. switch, rotate and reset run while every server is
  stopped, under the migration lock. rewrap, rotate and reset write the
  ring only while its row holds the ring they read.
- On Cassandra the commands read and write the key rows at ALL. On
  SQLite, switch, rotate and reset end with a VACUUM under
  secure_delete, so no free page keeps a ciphertext they replaced.
- At startup the server refuses a catalog whose key state does not
  match its configuration. The message names the command or the
  restore that fixes it.
- From #863: each backend and each extenddb backup command refuses a
  catalog key that is not base64 or does not decode to 32 bytes.
  ADR-0026 records that the MongoDB driver builds its TLS
  configuration with rustls::crypto::ring.

Without key_file, the stored format and the catalog key stay as they
are. The catalog key and the signing keys move into the locked key
store. When locking fails, the server logs a warning and starts.

The docs cover the KEK file, its delivery routes, the commands,
rollback, restore and a troubleshooting entry for each refusal.

Refs #707
Refs #776
LeeroyHannigan added a commit that referenced this pull request Nov 17, 2026
This change implements RFC-0000 for #707. The server can keep the key
that encrypts stored secrets outside the catalog, and it holds less
key material in memory.

- [auth.encryption] key_file names a key-encryption key (KEK) file by
  an absolute path. The KEK wraps a data encryption key (DEK), and the
  catalog holds the wrapped DEK in an encryption_key_ring settings row.
  The DEK encrypts the secret of each access key and each AssumeRole
  session. On PostgreSQL it also encrypts the
  data_database_connection_string row.
- The server refuses a KEK file that another user can read or replace.
  It checks the canonical path, each parent directory, the open
  descriptor and, on Linux, the POSIX ACL. It accepts group access
  only on a file that root owns.
- The additional authenticated data (AAD) of AES-GCM binds each stored
  secret to its row, and each wrapped DEK to every field of the ring.
- The credential cache holds one SigV4 signing key per access key and
  scope date, and the SHA-256 of each session token. It holds no
  plaintext secret or token. A key for a new scope date comes with the
  identity of the read that derives it.
- A locked key store holds the DEK or the catalog key, and the signing
  keys. It uses memfd_secret where the kernel has it, and otherwise
  mlock with MADV_DONTDUMP and MADV_WIPEONFORK.
- extenddb encryption-key has six commands: status, switch, rewrap,
  rotate, reset and set-data-connection. rewrap changes the KEK while
  the server runs. switch, rotate and reset run while every server is
  stopped, under the migration lock. rewrap, rotate and reset write the
  ring only while its row holds the ring they read.
- On Cassandra the commands read and write the key rows at ALL. On
  SQLite, switch, rotate and reset end with a VACUUM under
  secure_delete, so no free page keeps a ciphertext they replaced.
- At startup the server refuses a catalog whose key state does not
  match its configuration. The message names the command or the
  restore that fixes it.
- From #863: each backend and each extenddb backup command refuses a
  catalog key that is not base64 or does not decode to 32 bytes.
  ADR-0026 records that the MongoDB driver builds its TLS
  configuration with rustls::crypto::ring.

Without key_file, the stored format and the catalog key stay as they
are. The catalog key and the signing keys move into the locked key
store. When locking fails, the server logs a warning and starts.

The docs cover the KEK file, its delivery routes, the commands,
rollback, restore and a troubleshooting entry for each refusal.

Refs #707
Refs #776
LeeroyHannigan added a commit that referenced this pull request Nov 17, 2026
This change implements RFC-0000 for #707. The server can keep the key
that encrypts stored secrets outside the catalog, and it holds less
key material in memory.

- [auth.encryption] key_file names a key-encryption key (KEK) file by
  an absolute path. The KEK wraps a data encryption key (DEK), and the
  catalog holds the wrapped DEK in an encryption_key_ring settings row.
  The DEK encrypts the secret of each access key and each AssumeRole
  session. On PostgreSQL it also encrypts the
  data_database_connection_string row.
- The server refuses a KEK file that another user can read or replace.
  It checks the canonical path, each parent directory, the open
  descriptor and, on Linux, the POSIX ACL. It accepts group access
  only on a file that root owns.
- The additional authenticated data (AAD) of AES-GCM binds each stored
  secret to its row, and each wrapped DEK to every field of the ring.
- The credential cache holds one SigV4 signing key per access key and
  scope date, and the SHA-256 of each session token. It holds no
  plaintext secret or token. A key for a new scope date comes with the
  identity of the read that derives it.
- A locked key store holds the DEK or the catalog key, and the signing
  keys. It uses memfd_secret where the kernel has it, and otherwise
  mlock with MADV_DONTDUMP and MADV_WIPEONFORK.
- extenddb encryption-key has six commands: status, switch, rewrap,
  rotate, reset and set-data-connection. rewrap changes the KEK while
  the server runs. switch, rotate and reset run while every server is
  stopped, under the migration lock. rewrap, rotate and reset write the
  ring only while its row holds the ring they read.
- On Cassandra the commands read and write the key rows at ALL. On
  SQLite, switch, rotate and reset end with a VACUUM under
  secure_delete, so no free page keeps a ciphertext they replaced.
- At startup the server refuses a catalog whose key state does not
  match its configuration. The message names the command or the
  restore that fixes it.
- From #863: each backend and each extenddb backup command refuses a
  catalog key that is not base64 or does not decode to 32 bytes.
  ADR-0026 records that the MongoDB driver builds its TLS
  configuration with rustls::crypto::ring.

Without key_file, the stored format and the catalog key stay as they
are. The catalog key and the signing keys move into the locked key
store. When locking fails, the server logs a warning and starts.

The docs cover the KEK file, its delivery routes, the commands,
rollback, restore and a troubleshooting entry for each refusal.

Refs #707
Refs #776
amrith pushed a commit to amrith/extenddb that referenced this pull request Nov 20, 2026
…e the catalog (ExtendDB#1003)

* feat(auth): wrap the credential encryption key with a KEK file

This change implements RFC-0000 for ExtendDB#707. The server can keep the key
that encrypts stored secrets outside the catalog, and it holds less
key material in memory.

- [auth.encryption] key_file names a key-encryption key (KEK) file by
  an absolute path. The KEK wraps a data encryption key (DEK), and the
  catalog holds the wrapped DEK in an encryption_key_ring settings row.
  The DEK encrypts the secret of each access key and each AssumeRole
  session. On PostgreSQL it also encrypts the
  data_database_connection_string row.
- The server refuses a KEK file that another user can read or replace.
  It checks the canonical path, each parent directory, the open
  descriptor and, on Linux, the POSIX ACL. It accepts group access
  only on a file that root owns.
- The additional authenticated data (AAD) of AES-GCM binds each stored
  secret to its row, and each wrapped DEK to every field of the ring.
- The credential cache holds one SigV4 signing key per access key and
  scope date, and the SHA-256 of each session token. It holds no
  plaintext secret or token. A key for a new scope date comes with the
  identity of the read that derives it.
- A locked key store holds the DEK or the catalog key, and the signing
  keys. It uses memfd_secret where the kernel has it, and otherwise
  mlock with MADV_DONTDUMP and MADV_WIPEONFORK.
- extenddb encryption-key has six commands: status, switch, rewrap,
  rotate, reset and set-data-connection. rewrap changes the KEK while
  the server runs. switch, rotate and reset run while every server is
  stopped, under the migration lock. rewrap, rotate and reset write the
  ring only while its row holds the ring they read.
- On Cassandra the commands read and write the key rows at ALL. On
  SQLite, switch, rotate and reset end with a VACUUM under
  secure_delete, so no free page keeps a ciphertext they replaced.
- At startup the server refuses a catalog whose key state does not
  match its configuration. The message names the command or the
  restore that fixes it.
- From ExtendDB#863: each backend and each extenddb backup command refuses a
  catalog key that is not base64 or does not decode to 32 bytes.
  ADR-0026 records that the MongoDB driver builds its TLS
  configuration with rustls::crypto::ring.

Without key_file, the stored format and the catalog key stay as they
are. The catalog key and the signing keys move into the locked key
store. When locking fails, the server logs a warning and starts.

The docs cover the KEK file, its delivery routes, the commands,
rollback, restore and a troubleshooting entry for each refusal.

Refs ExtendDB#707
Refs ExtendDB#776

* fix(storage-cassandra): run the encryption-key statements through the consistency policy

Main sets the consistency level of each Cassandra statement through a Stmt kind and PolicySession::run. Its source scan refuses Consistency values and StatementParamsBuilder outside cassandra_util.rs.

The encryption-key statements of this branch named Consistency::All. They now use Stmt::ReadAll, Stmt::WriteAll and Stmt::LwtAll, and the read of a page of stored secrets uses run_paged. The ring update runs Paxos at LOCAL_SERIAL in place of SERIAL, as every other LWT on main does.

The doc comments now say that the other settings statements and the startup read of the key rows run at LOCAL_QUORUM.

* fix(storage-cassandra): cover the ALL kinds in the level tests and the setup guide

The merge of ExtendDB#945 added Stmt::WriteAll and Stmt::LwtAll for the encryption-key statements. The direct level test now sends both kinds to an under-replicated keyspace. WriteAll fails at ALL, and the Paxos round of LwtAll fails at LOCAL_QUORUM before its commit. One cassandra_util unit test now checks the levels of the three ALL kinds. The shape error for a conditional write names both LWT kinds. execute_at and apply_lwt_at are pub(crate), as rows_at is. docs/cassandra-setup.md says that the encryption-key commands need every replica of the catalog keyspace, because they read and write the key rows at ALL.

* test(storage-cassandra): check that the secret store sends at ALL

The direct level test gives a migrated catalog keyspace a replication factor of 2N + 1 on N nodes. The first statement of read_secret_page, write_secrets, delete_secrets and delete_setting then fails with an Unavailable error that names ALL. If the page read, the write-time read or the rewrite runs as Stmt::Read or Stmt::Write, the test fails. level_in now reads "cl: All". under_replicated and the new test share no_quorum_replicas, and with_replicas and the new test share one replication map. The test drops its catalog keyspace when it ends.
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.

1 participant