Repository navigation
docs(rfc): Couchbase storage backend - #1184
suravarjjala wants to merge 25 commits into
Conversation
Propose Couchbase Server as an ExtendDB storage backend, shipped as Couchbase Converge for DynamoDB Workloads: a crates/storage-couchbase crate installed through extenddb_storage::Backend behind a `couchbase` feature, native-JSON items with one reserved `_xdb` object, KV point reads, SQL++ Query/Scan over tid-scoped indexes, query-service ACID transactions, and code-based catalog and data migrations in the shape crates/storage-mongodb uses. Maps every RFC-0003 criterion to the mechanism and the test that proves it, and scopes the port from the v0.1.x pin the backend was built against to the Storage contract on main. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
LeeroyHannigan
left a comment
There was a problem hiding this comment.
Thanks for writing this up. I read it against main at 2ef5613, RFC-0002, RFC-0003, ADR-0023 and ADR-0026, and checked what it says about Couchbase against Couchbase's documentation. My answers to your eight questions are at the end. Before the final comment period, these need to change:
- The evidence is in a repository reviewers can't read. Every
docs/,scripts/andtests/path, QE id and job in the acceptance table points into it (lines 9 and 58-83). So nobody can check a row of the RFC-0003 table yet. The Summary's "912 passed, 1 xfail" adds up to 913. Line 781 gives 913 as the count of the stalee41f370checkout, which is main's commit for #307, and 1,234 for the pinned suite. The pin7b828b0isn't on main either: it's 308 commits behind main and has 6 commits main doesn't. Please open the repository now, or keep only the claims a reader of this PR can check. Please also say which suite at which commit produced each number. RFC-0003 asks fordevtools/run-tests --extenddb --allto pass in CI before the project accepts a backend. Please name that run with--backend couchbaseas the required gate, and use RFC-0003's suite names in place of "parity". - Plain KV writes and query-service transactions write the same documents, and nothing stated keeps them apart. Couchbase's transactions page says non-transactional updates shouldn't be made to a document while a transaction that involves it is in progress. The intent lease (lines 193 and 403) is a separate document, so a plain write checks it in one step and writes in another. An unconditional PutItem is a plain upsert with no CAS (line 758). The lease lasts 10 s and nothing renews it, while
txtimeoutdefaults to 30 s (line 397). The RFC also doesn't say whether the transaction holds the lease until Couchbase unstages every document. Please describe how each plain write path sees a staged transactional mutation in the same step as its write. Say what renews the lease, and what a plain write answers when it meets a staged mutation with no lease. Please also state the outcome for a PutItem and a TransactWriteItems on one key, in both orders. - A stream record can become visible after a record with a higher sequence number. Lines 424-426 say a consumer can never pass a sequence number whose write hasn't committed. On Couchbase the commit point is the ATR entry, and Couchbase unstages the documents after it. The same page calls that an eventually consistent commit for non-transactional readers. GetRecords is a non-transactional SQL++ read (line 429). So T1 can take number 5 and commit, and T2 can take 6, commit and unstage. A consumer can then read 6 and move past 5 while 5 is still staged. If T1's query node fails after the commit point, record 5 waits for cleanup. RFC-0003 5.2 forbids this, and main fixed the same class on PostgreSQL with migration 7,
StreamPending. Please name a mechanism that holds while Couchbase unstages documents. Please also add a test that holds T1 between its commit point and its unstaging while T2 commits. - TransactGetItems has no named isolation mechanism. Line 400 says the transaction locks each read. SQL++ transactions run only at READ COMMITTED (BEGIN TRANSACTION), and their reads get Monotonic Atomic View. The only lock the transactions page describes is a staged mutation, and a read doesn't make one. If the fix for the torn pairs stages a write on every item it reads, please say so. Please also say what that does to concurrent writers, CAS loops and stream records. DynamoDB's transactions guide says a TransactGetItems that conflicts with a single-item write is the one that fails, with
TransactionCanceledException. Please also say what stops a plain write to a ConditionCheck item between the check and the commit. - The backend answers contention between plain writers as a transaction conflict. A CAS loop that runs out surfaces a retryable
TransactionConflict(line 349). On a stream-enabled table every write is a transaction on the onestream_seqdocument (lines 362-364), so writers of different keys conflict there. RFC-0003 4.1 and 4.4 ask single-item writes and concurrent UpdateItem calls to succeed where DynamoDB handles the contention.TransactionConflictExceptionmeans that an ongoing transaction holds the item. Main's MongoDB backend has the same limit, answers 503ServiceUnavailableafter 50 attempts, and documents it indocs/differences-from-dynamodb.md. Please state the attempt and time bounds and the answer at each. Say what theALL_OLDput at line 758 writes and returns at its deadline, and add the rows to the differences document. - A 100-action, 4 MB TransactWriteItems has no stated fit in Couchbase's limits. Line 684 says one can run past the 30 s
txtimeout, and the query service bounds a transaction's delta table by itsmemory-quota. Please name the query-service settings the backend needs and what the client gets when a valid request exceeds them (RFC-0003 9.2). Please add a test at 100 actions and 4 MB. EXTENDDB_SCAN_CONSISTENCY=eventual(lines 335-339) answers a Query or Scan that setsConsistentRead=truefrom an index that can lag, LSI reads included.DataEngine::queryandscancarry no consistency flag on main (crates/storage/src/lib.rs:381-420), so the backend can't tell those requests apart. RFC-0002 allows an eventual read served as strong (line 83) and a stronger opt-in mode (line 118). It allows no mode that weakens a read. Please drop the setting until the trait carriesConsistentRead. Lines 373-374 also say index reads are strongly consistent, where row 2.7 says the backend doesn't advertise strong GSI reads. Please make them agree.- A write that hasn't seen a new GSI can land after the backfill passed its item. UpdateTable writes the index row as
CREATING, and the reconciler backfills and flips it toACTIVE(lines 376-380). Meanwhile a write uses a catalog read up to 2,000 ms old (line 525), or the key info its request loaded. Such a write stores the item without the new derived keys after the backfill passed it, and the index goesACTIVEwithout it (RFC-0003 2.4). The sub-document fast path has the same gap. Please name the fence. - The key encoding needs to be specified. Couchbase limits a key to 246 bytes in a named collection, and allows 250 only in the default collection (Data). Every item here lives in a named collection, so line 727's 250-byte threshold lets a key of 247 to 250 bytes through to a refusal. Please give the S and B encodings of
_xdb.pkand_xdb.sk(hex keeps unsigned byte order, standard base64 doesn't). Give the hashed form and why it can't collide with a literal key, whether a hashed lookup compares the stored key, and the shape ofLastEvaluatedKey. RFC-0003 1.2 asks for a scheme that's provably collision-free. The example document (lines 274-283) also has_xdb.sk: "N#21001"with no top-level attribute for that sort key. - A descending Query has no index in its order. There's one ascending base index (line 321) and one GSI per DynamoDB index. Couchbase's ORDER BY page says a query that sorts opposite to its index may run slower, and suggests a second index in the opposite order. Please say how the backend serves a
ScanIndexForward=falsepage without reading the whole partition first, and add descending paging to the tests. - The shared tier has no stated bound. Every table's GSIs, LSIs, TTL index and vector indexes are indexes on
data.items(lines 188 and 369). So the index work of each write grows with every table in the tier. The budget check counts keyspaces in its bucket (line 584), but Couchbase's limit of 1,000 collections is per cluster (Scopes and Collections). Couchbase's Operator documentation also gives 10,000 indexes per cluster. Please count both across the cluster, and say what CreateTable and UpdateTable answer at the limit. Please also replace "effectively unlimited tables" (line 577) with a measured bound. - The migration plan covers ids 1 and 2 of main's 12. The exhaustive match (lines 218-220) needs an entry for each of ids 3 to 12, either a body or
NotApplicablewith its reason. At least 6, 10, 11 and 12 apply here. Lines 213-217 delete thecatalog_versionsettings document. But the shared runner writes that row with every catalog ledger row (LedgerWrites::write_version,crates/storage/src/migrations/record.rs:33), and ADR-0023 reads it to answerWrittenByOlderReleaseandUninitialized. The lock and the serving registration (lines 244-253) need the renewal, expiry and loss values ADR-0023 gives for every backend. The base-index rebuild that stays in the engine (lines 259-261) runs outside the runner, and ADR-0023 allows no shape step outside the migration list. Line 238's reason for writing the ledger row after the body also needs a fix. Couchbase has multi-document KV transactions through its SDKs. What rules them out here is the Rust SDK, which has none, and a SQL++ transaction, which takes no DDL. - The backup section contradicts main. For a backend that can't fix an instant across a table, main's answer is Cassandra's. Its
open_table_snapshotreturnsUnsupported, and CreateBackup takes the in-catalog create (crates/storage/src/snapshot.rs:20-22,crates/storage-cassandra/src/snapshot_engine.rs).docs/differences-from-dynamodb.mddocuments the divergence. Main has noBackupEnginetrait (line 505). Point-in-time recovery isn't "snapshot-now only" (line 497): the engine refuses those operations for every backend. Export and import aren't mentioned, and on main export is a paged Scan with no point in time. Please follow Cassandra, or describe a mechanism that fixes an instant, and add a paragraph on export and import. - Secret storage should use main's code. The workspace would gain
aes-gcm(line 648), which ADR-0026 took out of the workspace when it moved secret encryption toextenddb_storage::secret_cipheron aws-lc-rs. The settings table keepsEXTENDDB_ENCRYPTION_KEY[_FILE]and its_PREVIOUSpair (line 634) beside the key ring of lines 482-484, and passwords already go throughextenddb_storage::password. Please dropaes-gcmand those settings, and usesecret_cipher, the key ring and the shared password code. Please also say whether the backend ships with main's default key placement or requireskey_file. - The settings should be
[storage.couchbase]keys. Main's backends read[storage.<backend>]keys withEXTENDDB__STORAGE__<BACKEND>__<KEY>overrides, and the settings table (lines 625-634) and lines 599-600 useEXTENDDB_*environment variables instead. One of them,EXTENDDB_QUERY_TLS_INSECURE=1(line 600), turns off certificate checks at run time. "Dev-only" needs a mechanism, and main's dev mode is a build feature. The sample config also puts the Couchbase password inconnection_string(line 622), where main takes a backend password from its own environment variable. Please move the settings to[storage.couchbase], take the password fromEXTENDDB_COUCHBASE_PASSWORD, and make the insecure TLS switch a build feature or delete it. - ExtendDB runs one server per catalog.
README.md:64says so for every backend, and the HA design (lines 514-542) and the Helm chart's two replicas (line 637) rely on several. The engine also keeps per-process state beyond the key info thatEXTENDDB_CATALOG_FRESHNESS_MScovers, the auth cache and console sessions among it. Please state one server per catalog and set the chart to one replica. The multi-server design changes every backend's deployment model, so it needs its own RFC. - Please state the tier, the edition and the CI job. A new backend enters at Experimental (
README.md:49-62), and lines 104 and 107-108 talk about GA and a production deployment surface. CI and the demo run Couchbase Server Enterprise 8.0.0 (line 589). The image's Enterprise licence is free for development and testing, and production needs a subscription. Community Edition allows clusters of up to five nodes and has no XDCR (Editions). Please say which edition the backend needs and what works on Community Edition. Name the required CI job and its image, and add the README row.cmd_serve.rs(line 647) has no backend gate, so please drop it from the implementation summary. The first release that shipsextenddb-storage-couchbasealso takes ADR-0029's new-crate steps. destroyneeds a stated scope (line 197). An operator's bucket can hold other scopes, andcataloganddataare names another application can use. Please say thatdestroydrops only what the catalog records, never by pattern. Say whatinitdoes with acatalogordatascope it didn't create, and that one bucket holds one deployment.- The licence footer (lines 965-967) says ExtendDB isn't affiliated with AWS. The template and every RFC and ADR on main say "ExtendDB is an open source project maintained by AWS. It is not Amazon DynamoDB or an AWS service." Please copy the template's footer.
Please also fix these smaller ones:
- The console known issue (lines 851-860) describes code that main fixed.
account_detailrequires a session for that account and an admin, andmetrics_dataanswers 403 to a non-admin. - The engine already refuses
begins_withon a number sort key with the service's message (crates/engine/src/query.rs:674-693, measured on 21 Oct). The backend's own check (lines 323-325) and the divergence line in #1183 can go. - One stream shard (line 421) differs from the four every backend takes from
extenddb_storage::stream_lineage::SHARDS_PER_STREAM. Four shards would also split the counter of item 5. Please use the shared constant, or give the reason for one. - XDCR (lines 50-56) is Enterprise only. It can deliver part of a transaction when a connection drops, and the transactions page advises against active-active replication with transactions.
- Lines 126-127 and 927-928 state what AWS intends, with no public source. Please delete them or cite one.
- The multi-attribute RANGE limit (lines 382-384) points at a private checklist. Please name the ExtendDB issue, and put the limit in the README row as MongoDB and Cassandra do.
- Some names aren't on main.
BackupEngineappears at lines 153 and 909.CredentialStoreis a trait ofcrates/auth, and line 155 lists it with the storage modules.validate_index_key_valuesdoesn't exist (line 738), and the shared validators are incrates/core/src/validation. - One
MutateIntakes at most 16 operations (sub-document operations). On a v3.2 table eachSETtakes two (lines 357-358), so an UpdateItem with more than eightSETactions has to fall back. Please say so. - Couchbase supports durability for up to two replicas (Durability), so the preflight (lines 601-610) should refuse a bucket with three.
- A failed statement in a SQL++ transaction rolls back that statement only, and the transaction goes on. Please say the backend issues
ROLLBACKwhen the token insert fails. Main releases the token of a cancelled transaction (tests/test_conditional_atomicity.py:272), so a retry with the same token runs again once the condition holds. - "Native JSON number when a double round-trips exactly" (line 659) needs to say what it compares. The value has to come back as the text
normalize_numberproduces (crates/core/src/validation/number.rs). For example, 2^60 is exact as a double, but a shortest round-trip formatter prints it as1.152921504606847e18. - A TTL value kept as an exact string in the sidecar (lines 296-297) doesn't match
#ttl <= :now(lines 453-454). - Please pin the Rust SDK at 1.1.1 or later (line 648).
I'd answer your questions this way:
- Phases are fine if each PR carries complete traits with its tests passing in the required CI job (RFC-0002 rule 3). The first needs the mandatory traits, an entry for every migration id, the CI job and the README row at Experimental.
- Point-in-time recovery isn't a backend trait on main, and
BackupEnginedoesn't exist.VectorSearchEngineis optional under RFC-0002 rule 2. Either implement it and pass every vector test, with approximate results noted in the differences document, or leave it out, as MongoDB and Cassandra do. - No trait change in this RFC. RFC-0002 already allows an eventual read served as strong. Please drop the
eventualsetting meanwhile (item 7). - Use four shards (above). For backups, see 8.
- 8.0, the version CI runs and composite vector indexes need, with the edition named (item 17).
- One server per catalog in 1.0 (item 16).
- Replication and change data capture need their own RFC (
docs/rfcs/README.md). Unsupported, as on Cassandra, with a Couchbase entry in the backup row ofdocs/differences-from-dynamodb.md. A write fence makes CreateBackup affect writes, and AWS says DynamoDB backups don't.
Line 428 is right, and I measured it on DynamoDB today. A PutItem of an identical item, an UpdateItem that changes nothing and a DeleteItem of a missing key wrote no stream record. Main gets this wrong, and I've filed it as #1229.
Responds to the review on ExtendDB#1184: evidence named by suite revision with the pinned-suite run; key encoding and the hashed key form; the intent lease, its renewal and the staged-mutation guard, with both orders of a plain write and a transaction on one key; the locking read behind TransactGetItems; CAS and lease bounds and the 503 at exhaustion; the actual stream mechanism (number before commit, reader stops at an unresolved number) with cleanupwindow in the abandonment age; the GSI backfill fence; cluster-wide limits; an entry for all twelve migration ids; Unsupported snapshots and in-catalog backup; secret_cipher and the key ring; [storage.couchbase] settings; one server per catalog; Experimental tier and the edition; four stream shards; destroy scoped to the catalog; the template footer. Vector search and the two AWS lines are removed. Open engineering items are listed with their tests. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
LeeroyHannigan
left a comment
There was a problem hiding this comment.
Thanks for revision 2. I read it at 38ee34b against main at 89fc971, and checked the new statements about Couchbase against Couchbase's documentation.
Revision 2 resolves items 7, 13, 14, 15, 16, 17 and 19. Of the smaller ones, it resolves the console known issue, begins_with on a number sort key, four stream shards and the AWS-intent lines. It also resolves the names that aren't on main, the SDK pin and the three-replica preflight. The same goes for ROLLBACK with the token release, the number text against normalize_number, the TTL string and XDCR.
Each point below names the round 1 item it continues. Two of the new mechanisms can't meet RFC-0003 as written:
- Item 9. The document key collides when an S key value contains
|. S isS#plus the string's bytes, unchanged (line 370), and the key is<table_id>#<pk_enc>|<sk_enc>(line 378). Item A with pkxand sky|S#z, and item B with pkx|S#yand skz, both get<table_id>#S#x|S#y|S#z. The hashed form hashes the samepk_enc|sk_encstring, so long keys collide the same way. RFC-0003 1.2 rules out an unescaped delimiter that can appear in key values. Lines 387-390 and row 1.2 say a value can't forge a boundary, and an S value can. Please length-prefixpk_encor escape|in S values, and add a partition key that contains|S#to the separator-collision test. Main hasextenddb_storage::util::key::encode_netstring_composite, which MongoDB, Cassandra, PostgreSQL and SQLite use. Please use it for the raw form, or say why not. - Item 3. The age that resolves a missing stream number lets a reader skip a committed record. Lines 626-632 abandon a number once the next record is older than
txn_timeoutpluscleanupwindowplus 15 s, which is 105 s with the defaults. The reason given is that cleanup unstages a committed transaction withincleanupwindow. Couchbase gives no such bound.cleanupwindowsets how often the query service checks its transaction records (query settings). The cleanup page says cleanup generally finds expired transactions within the window. It also names a downed node that the cluster has not failed over yet as a reason cleanup can still fail two hours past expiry. Auto-failover defaults to 120 s (Automatic Failover). So when the data node that holds a committed record fails, the reader passes its number at 105 s. Cleanup unstages the record after the failover, when every consumer has already passed its number. That breaks RFC-0003 5.1 and 5.2. One way that holds: before passing an aged number, read its record inside a transaction. The transactions page says a transaction reads the committed version as soon as the ATR entry says committed. If that read finds the record, deliver it. Skip the number only if the read finds nothing after the attempt expired. If the read fails, keep the stop. Please also extend open item 2's test to a hold longer than the age.
These still need to change:
- Item 1. The reference repository still answers 404 to my account. Line 9 says the first reviewer has access, and I'm the first reviewer. Please give me read access and say on line 9 when you granted it. Or mark every entry that only the private repository can show as unverified until it opens. Row 6.3 says the pinned suite passes all five baseline failures against the same build. The only pinned run in the RFC (lines 73-81) fails the three
test_abac.pycases. Please name the run behind row 6.3, or narrow the sentence. - Item 3, the skip marker. A writer leaves a skip marker for a number "because its transaction did not commit" (lines 625-626). A
COMMIT WORKcan fail with an unknown outcome, and a marker written then can hide a committed record. Please write a marker only after a rollback that succeeded, or after an error that came before the writer sentCOMMIT WORK. Please also say that LATEST and AT_TIMESTAMP iterators start no later than the first unresolved number. - Item 2. The guard looks for the
txnextended attribute on the target document (lines 540-545). For a key that doesn't exist yet, Couchbase's transactions how-to says non-transactional actors can't see a transaction's staged insert. The RFC names no step by which the guard sees that insert. Take a PutItem that reads the lease before a TransactWriteItems takes it. If the PutItem writes after the transaction staged its insert of that key, it can pass the guard. The same holds after a lease lapses because renewals failed. The transaction concepts page says either write may then win, even with CAS, so the acknowledged PutItem can be lost. Lines 519-520 say the transaction then fails its validation at commit, where the page calls the outcome undefined. Please name the step that covers a key the transaction creates. Say that a transaction whose renewal fails rolls back beforeCOMMIT WORK, and add the create case to open item 1's test. The guard also depends on the name and rule of thetxnattribute, which Couchbase doesn't document. Please cite the source and name the versions you checked it on. Please also add a live test that stages a mutation and checks that the backend refuses each plain write path. - Item 4. An absent key isn't protected. Lines 560-562 give it a staged insert that the transaction deletes again. I found nothing in Couchbase's documentation on what an insert and a delete of one key in one transaction leave staged. A plain PutItem also doesn't see a staged insert (point 5). So between a TransactGetItems' reads of A and B, a PutItem can create A and another can change B. The TransactGetItems then returns A absent with B's new value, which RFC-0003 3.5 forbids. Please read the absent keys again after the last read, or lease them. Please also add a test where a PutItem creates an absent key during a TransactGetItems.
- Item 4, the other direction. A plain writer that meets the read's staged lock takes the conflict path (lines 564-566), which answers
TransactionConflictException. DynamoDB's transactions guide lists a PutItem as conflicting only with an ongoing TransactWriteItems, and fails the TransactGetItems when it meets a PutItem. Lines 445-446 also say that answer comes only from a transaction's intent lease, and a TransactGetItems takes none. Please retry the plain write within the 64-attempt, 10 s budget, answer 503 at its end, and give the 10 read attempts a time bound. - Item 5. Single-item writes on a stream-enabled table have no stated answer when two meet. Each runs as a query-service transaction (lines 467-468 and 504), and the RFC doesn't say whether it takes an intent lease. If it does, a second PutItem on the key answers
TransactionConflictException(lines 531-534) orTransactionCanceledException(line 555). Main'stest_racing_puts_on_a_stream_table_all_succeedexpects both to succeed. Please state the answer, keepTransactionConflictExceptionfor a live TransactWriteItems, and say how a write tells the two apart. Row 4.4 says writers of different keys contend on the shard counter. Lines 616-617 take the number with an atomic KV increment, which doesn't conflict, so please delete that clause. - Item 6. Lines 902-904 say a 100-action TransactWriteItems can run past
txtimeout, and the query settings page says no statement continues after it. Please state the answer before and after the commit point.memory-quotadefaults to 0, which means no quota, so please write the requirement as 0 or at least the measured value. Please also measure on a stream-enabled table withNEW_AND_OLD_IMAGES, whose records add both images to the transaction. - Item 8. The fence starts at the catalog row (lines 483-491). Main's
CachedTableKeyInfoStore(crates/server/src/key_info_cache.rs) is a stale-while-revalidate cache, and UpdateTable invalidates it after the catalog mutation succeeds. A request that starts between the row write and the invalidation carries the old index list, and the fence doesn't wait for it. A count of request starts also shows that later requests began, not that earlier ones finished. Please start the fence at the invalidation and wait for the requests in flight, the reindex reconciler's writes included. Please add that window to open item 5's test. - Item 9, numbers. Please give the N encoding's byte layout: field widths, the exponent bias, and the complement and terminator for negative numbers. Please add encoded values for a few numbers, such as -1.55, -1.5, 0 and 1.5. The example's
N#21001for 1 andN#2100325050for 250.50 don't follow one layout. - Item 10. Couchbase's documentation answers the
EXPLAINquestion. The index pushdowns page says order pushdown needs the ORDER BY keys aligned with the index order, and that a reverse scan isn't supported. Please make the descending twins part of the design and count them in the index budget. - Item 11. Please say whether the budget counts index replicas and the twins, and how two concurrent creates stay under the limit.
- Items 12 and 18. The lock is a document in
catalog.settings(lines 288-289), and the baseline creates that collection under the lock (line 262). On main, the Cassandra backend has the same order and runscreate_lock_tablebefore it takes the lock. Please do the same, or keep the lock in_default._default. Lines 231-233 call a scope with noextenddb_migrationsledger someone else's, soinitrefuses the out-of-tree deployment that row 1 adopts. On main the foreign-store check reads the contents, and only on anUninitializedstore. Please do the same and name the command that adopts. The table also needs each entry's kind and convergent flag (ADR-0023 decision 1). Row 1 should say it deletes theresource_tag_migrationmarker, as ADR-0023 decision 4 does. - The multi-part RANGE limit. Lines 493-497 say the engine refuses a Query with conditions on two or more RANGE parts. On main,
KeyCondition::resolve_multipart_withaccepts them, since #381 closed on 31 Oct. A backend that filters only the first RANGE attribute refuses the rest withextenddb_storage::util::key::refuse_conditions_beyond_first_range, as MongoDB and Cassandra do, and their README rows state the limit. The issue those lines say this revision opens doesn't exist, and #1183 is the only issue you've opened. Please use the shared helper and the same README wording.
Please also fix these smaller ones:
- The
MutateInlimit leaves out the guard's two operations (lines 540-543). That leaves 14 for the update, so the limit is seven v3.2SETs, and open item 3 should test eight. - Step 1 (lines 736-739) should carry the mandatory traits, the
couchbase-integrationjob and the README row, as my answer 1 asked. - Prior art (lines 1175-1177) credits the Cassandra draft with the
Unsupportedsnapshot and the ledger-after-body pattern. The draft has neither. They are ADR-0023 decision 2 andcrates/storage-cassandra/src/snapshot_engine.rs. check-cassandra-schemaisn't on main (lines 312-314). Cassandra has the other two checks.sha2is already a workspace dependency (line 862).devtools/run-tests --backendtakes postgres or mongodb, so the gate also needs a change there.- The PR description and #1183 still say "parity 331/331", give the
EXTENDDB_*settings, and list thebegins_withdivergence.
Responds to the second review on ExtendDB#1184. Plain writes and transactions no longer meet at the document: on a table a transaction has touched, both take one lease document per item (KV insert, fail-if-exists), a transaction verifies its leases before COMMIT WORK and marks them committing across the commit, and a plain write that meets a committing lease runs as a transaction; TransactGetItems leases every key it reads. The stream reader resolves an aged number by a transactional read of the record, never by age alone, and skip markers are written only after a definite failure. Key encoding: the escape of | in key components (the code's existing behavior), the N layout with encoded examples, corrected example document. Descending twin indexes; the GSI backfill fence at the cache invalidation with an in-flight counter; cluster-wide budget with twins and replicas under the create lock; migration kinds and convergent flags, the lock in _default._default, the foreign-store rule and adoption; multi-part RANGE support on every part; timeout and unknown-outcome answers; row 6.3 narrowed to the pinned run; the smaller corrections. Open engineering items extended, with the lease cost measurement. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Thank you for the second read. Revision 3 is on the branch and answers each point below by its number. The main change is a design change you asked for in substance: plain writes and transactions no longer meet at the document at all. Access. The invitation to your account was sent on 2026-11-24 at 19:15 UTC and is still pending; GitHub answers 404 until it is accepted at https://github.com/couchbaselabs/extenddb-couchbase/invitations. Line 9 now says so, and says that until a reviewer has read the repository, every path and QE id in the RFC is a claim only it can show.
Smaller items. With the guard withdrawn the |
LeeroyHannigan
left a comment
There was a problem hiding this comment.
Thanks for revision 3 and the reply. I read it at 0f4832a against main at 3534c9e, and checked the new statements about Couchbase against Couchbase's documentation.
Revision 3 resolves points 1, 2, 4, 7, 8, 11 and 12. It also resolves the MutateIn count, step 1, the prior art credits, check-couchbase-schema, sha2 and run-tests --backend. I checked the key scheme offline from the RFC's text. The escape gave no collision over 8,071,281 two-part keys built from \, |, #, |S# and the empty string. The twelve N values match the layout, and encoded order matched numeric order over 54,866 numbers.
One of the new mechanisms can't meet RFC-0003 as written:
- The
transactionalflag (lines 631-637). On a table without the flag, a plain write takes no lease and is one KV write. The first TransactWriteItems or TransactGetItems on a table sets the flag and then takes its leases. A PutItem that read the flag as unset before that has no lease. Its KV write can land while the transaction commits the same key, and nothing waits for it. Couchbase's transaction concepts page says either write may then win, even with CAS. So the transaction can be partly applied, or an acknowledged PutItem can be lost. The same race lets a PutItem create an absent key during the first TransactGetItems. Lines 636-637 say no other process can hold a stale view, but this race is inside the one server. If the server reads the flag through main'sCachedTableKeyInfoStore(crates/server/src/key_info_cache.rs), the window is longer. That cache serves an entry until its TTL ends or a handler that changes the catalog row invalidates it. A TransactWriteItems isn't such a handler. Please fence the flag the way lines 549-558 fence a new GSI. Wait for every plain write that read the flag before the transaction set it. Your unresolved question 3 offers the other way, a lease on every table. That makes the flag unnecessary and closes this window, at the cost open item 12 measures. Please also add a test for it. Hold a PutItem between its flag check and its KV write while the first TransactWriteItems commits that key.
These still need to change:
- A TransactWriteItems deletes its
committingleases when "the commit has returned and Couchbase has unstaged every document" (lines 611-612). I found no Couchbase page that says a query-serviceCOMMIT WORKreturns only after unstaging. The SDK's error handling page says a transaction can reach its commit point and return before unstaging is complete. Cleanup then finishes the commit. If the leases go first, a plain write can meet a staged committed mutation at the document. The lease is there to prevent that overlap. The unknown-outcome answer (lines 683-690) has the same gap. It answers success when it finds the token, but a GetItem, a KV get (line 460), can return the old item until cleanup runs. That breaks RFC-0003 4.5. Please cite a source for the unstaging, or measure it. Otherwise, keep eachcommittinglease until a KV read shows the committed body, and answer success only after those reads. The error handling page gives the same advice to an application that needs the commit visible to non-transactional readers. - A plain write can outlive its own lease. The lease expires after 10 s (line 599), and only a TransactWriteItems renews it. A plain write holds its lease through the CAS loop, which can last 10 s (line 502). Each attempt at
majoritydurability can also wait for the durable-write timeout, 10 s by default (durability). So the lease can expire while the write is still in flight, and a transaction can take the key in that gap. Please give theplainlease an expiry above the write's budget plus that timeout. Or stop new attempts when too little of the lease remains. Please also make every lease delete, and the rewrite tocommitting, a CAS operation on the owner's version. - A TransactWriteItems or TransactGetItems that meets a
committinglease has no path. Only a plain write runs as a transaction then (lines 625-631). A TransactWriteItems cancels after 2 s (lines 603-605), and a TransactGetItems after 10 attempts or 5 s (lines 669-672). Acommittinglease lives 24 h (line 611). A query node that fails past the commit point keeps the lease in place. So does a backend crash between the rewrite andCOMMIT WORK. Every transaction on that item then cancels until a plain write runs or 24 h pass. No transaction is in flight on the item then, soTransactionConflictdoesn't describe it. Please give transactions the plain write's rule. Please also have a transaction that never sentCOMMIT WORKdelete itscommittingleases on a definite failure. - Lines 757-759 say a single-item write on a stream-enabled table runs as a query-service transaction "after checking that no such lease holds the item". That check looks for a
transact_writelease only. Lines 616-618 say every plain write on a flagged table takes theplainlease. If only the check runs, a PutItem on a flagged stream-enabled table can create a key that a TransactGetItems holds under atransact_getlease. That reopens round 2's point 6 on those tables. A check followed by a write is also the race of round 2's point 5. Please say that every single-item write on a flagged table takes theplainlease. Please also add a stream-enabled table to open item 4's test. - The index backfill (lines 547-549) and the reindex reconciler (line 556) write items without a lease. The lease rule names only the API writes (line 616). On a flagged table, a TransactWriteItems can stage an item while the backfill writes it, and Couchbase calls that outcome undefined. Please have the background writers take the item's lease, and add that case to open item 5's test.
- Row 4.1 (line 1117) still says a bare PutItem is one KV write with no retry, so two racing calls both succeed. On a flagged table it takes the
plainlease. A write that meets another plain write's lease retries, and answers 503 at the end of its 10 s budget (lines 620-625). RFC-0003 4.1 asks that two concurrent unconditional PutItem calls both succeed. Plain writes only need to exclude transactions. Please let them share the lease. Or state the bound and the 503 in row 4.1 and in the differences document. Please also run main'stests/test_put_item_create_race.pyand thetest_atomic_countertest oftests/test_concurrency.pyon a flagged table. - A TransactGetItems writes the documents it reads, by deleting and re-inserting them (lines 655-658). It gets none of the TransactWriteItems lease rules: no renewal, no CAS check before
COMMIT WORK, nocommittingstate. If its query node fails after the commit point, its re-inserts stay staged while its 10 s leases lapse. A plain write can then take a lease and write the item. When cleanup unstages the read's re-insert of the older body, the acknowledged write is lost. Please give TransactGetItems the same lease rules, and add it to open item 1's node-failure test. - Lines 230-235 say the backend reports an out-of-tree deployment as
WrittenByOlderRelease, and thatmigrate --yesadopts it. On main, a store with acatalog_versionrow and no ledger is a catalog (Snapshot::initializedincrates/storage/src/migrations/runner.rs). ADR-0023's status table gives such a catalogBehindat migration 1.WrittenByOlderReleaseneeds a ledger row for migration 1, andmigrate --yesrefuses that status (refusalincrates/storage/src/migrations/catalog.rs). The adoption itself works, sincemigrate --yesapplies the baseline to aBehindcatalog. Please say that. Please also defineUninitializedascrates/storage/src/migrations/status.rsdoes: no ledger row and nocatalog_versionrow. - Lines 561-568 say you verified the per-part predicates against the engine's
resolve_multipart_with. That function came with #429, the fix for #381, on 31 Oct. The backend builds against the pinned rev 7b828b0 (lines 859-862), whose commit date is 23 Oct and which doesn't contain #429. Please name the ExtendDB revision that check ran on, or leave the claim to open item 13. Please also name the tests. Main's file for conditions on several RANGE attributes istests/test_gsi_multi_range_query.py. If the fallback ships,couchbasegoes into that file'sFIRST_RANGE_ONLY_BACKENDSand into the row ofdocs/differences-from-dynamodb.mdthat names the two refusing backends. The README row should then say which behaviour ships. - Line 9 now marks the paths and QE ids as claims only the reference repository can show. The figures, job and build numbers and that repository's issue numbers rest on it too. So does what the RFC says the code does. Please mark them the same way, and keep row 6.3 OPEN until a reviewer has read the repository.
Please also fix these smaller ones:
- The lease writes (lines 597-611) name no durability, and a lease lost in a failover lets a plain write into a commit. Please give them the backend's
durabilitysetting. Please also say what<item key>is in the lease key. If it's the full document key, a 240-byte key gives a 257-byte lease key, past Couchbase's 246. - The stream reader (lines 738-747) should read the record by its key. An index scan may not return a committed insert that Couchbase hasn't unstaged yet. The age assumes the attempt expires
txn_timeoutafter it took its number. Thetxtimeoutclock starts only whenBEGIN WORKsucceeds (query settings), andBEGINcan retry on another node. Please take the number afterBEGIN WORKreturns. Please also say that a writer that sentCOMMIT WORKwrites no skip marker, whateverROLLBACK WORKanswers. - The fence's one counter per table (lines 553-557) also counts requests that start after the invalidation. It shows the earlier ones finished only when it reaches 0, which a busy table may never do. Please count per key-info generation.
- The index budget check runs "under the server's create lock" (lines 910-914). Main has no such lock, so please say it's the backend's own and where the backend holds it. The reconciler builds an UpdateTable's indexes later (lines 546-549), so the check should also count the catalog's
CREATINGindexes. The TTL term says "plus two", where each index takes1 + index_num_replicascopies by the rule above it. - Rows 1.1 and 1.2 (lines 1086-1087) still describe the key without the escape. Row 1.2's reason is the one round 2's point 1 showed doesn't prevent the collision.
- Open item 1's live test checks only that plain writes refuse while another request holds the lease. That passes when a plain write reads the lease instead of inserting it, or reads a stale flag. Killing the query node "after
COMMIT WORKis sent" doesn't show that the transaction reached its commit point either. Please check that with a transactional read of the token. - Open item 12 measures throughput and latency. RFC-0003 4.1, 4.3 and 4.4 depend on how many writes on one hot key end in 503 or
TransactionConflictException, so please report those counts too. - A TransactWriteItems without
ClientRequestTokenhas no token to read on an unknown outcome (lines 683-690). Please say what the backend does then. - Line 213 still lists the migration lock in
catalog.settings. Lines 297-299 put it in_default._default. - Lines 257-258 say the baseline deletes the marker "once it has recorded migration 2 from it, as ADR-0023 decision 4 does". In decision 4, migration 1 deletes the marker and records nothing for migration 2.
- The PR description and #1183 still describe "an intent lease", and the description still says reviewer access is on request. Please describe the per-item lease and the
transactionalflag instead.
This was in revision 2, so it isn't a condition here: lines 801-802 name the extenddb key commands, and main's command is extenddb encryption-key.
The engineering items revision 3 listed are implemented and merged in the reference repository (commits b0c272f, 5e8462b, f4f293d), each with its test, and the three-node harness passes 19 of 19 with the new commit-point hold (a query engine frozen 60 s under transactional, plain and stream load: balance conserved, no acknowledged write lost, the stream reader never passed a number whose record appeared later). The acceptance rows marked OPEN are closed; "Open engineering items" becomes a status table; the 100-action transaction and the lease cost are measured on the demo stack; EXPLAIN confirms the descending twin; the hot-key observation (plain writes under a transaction firehose) is recorded under Drawbacks. Still pending: the multi-part RANGE tests (blocked on the pin), the performance-cluster figures, and the shared-tier bound. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
LeeroyHannigan
left a comment
There was a problem hiding this comment.
Thanks for revision 4. I read it at 6111e88 against main at 5252eda.
Revision 4 doesn't change the text of the Transactions section: lines 608-710 match revision 3's lines 588-690. Its new text says that the reference repository implements the engineering items of revision 3. This review covers the RFC text, so the design that the RFC states has to meet each point below. We can't read that repository yet, so this review can't check the claims that rest on it.
These points from round 3 are still open:
- The
transactionalflag window (lines 653-659) still blocks acceptance. A plain write that read the flag as unset can still land while the first transaction commits the same key. Lines 656-657 still say that no other process can hold a stale view, but the race is between two requests in that one server. Unresolved question 3 (lines 1344-1347) offers the lease on every table and now gives its cost on the demo stack. Please fence the flag and add the held-write test from round 3, or take the lease on every table and drop the flag. If the flag stays, question 3 should say that the flag needs the fence, and what the fence costs. - The
committingleases are still deleted whenCOMMIT WORKreturns, and the unknown-outcome answer is unchanged (lines 630-635 and 702-710). Couchbase's transactions page calls unstaging an eventually consistent commit for KV reads. - A plain write can still outlive its lease, and the lease deletes and the
committingrewrite still use no CAS (lines 517, 619 and 630-638). - Every transaction on an item with a
committinglease still cancels until a plain write runs or 24 h pass (lines 622-625, 645-651 and 689-692). - Single-item writes on a stream-enabled table still check for a
transact_writelease only (lines 782-784, against lines 636-640). - The fence now runs two backfill passes (lines 568-578), and neither pass takes the item's lease.
- Row 4.1 (line 1145) is now closed. A plain write that meets another plain write's lease still retries. It answers 503 at the end of its 10 s budget (lines 643-645 and row 4.3). Please let plain writes share the lease, or state the bound and the 503 in row 4.1. Please also run the two upstream tests from round 3 on a flagged table.
- A TransactGetItems still deletes and re-inserts its documents without the TransactWriteItems lease rules (lines 672-695).
WrittenByOlderReleaseandUninitializedare unchanged (lines 239-245). On main, a store with acatalog_versionrow and no ledger isBehindat migration 1 (crates/storage/src/migrations/status.rs).- Lines 584-588 still say the per-part predicates were "verified against the engine's
resolve_multipart_with". Item 13 (line 1236) now says that the engine at the pin refuses those queries before the backend sees them. So that check can't have run at the pin. Please drop "verified", or name the revision it ran on. Please also add an acceptance row that namestests/test_gsi_multi_range_query.pyand the behaviour that ships. That's either the per-part predicates with that test passing, orcouchbasein itsFIRST_RANGE_ONLY_BACKENDS, indocs/differences-from-dynamodb.mdand in the README row. - Line 9 is unchanged. It marks each
docs/,scripts/andtests/path and each QE id as a claim that only the reference repository can show. Revision 4 closes every row that revision 3 left open, on commits in that repository (lines 86-94 and 1107-1108). Those are rows 2.4, 3.5, 4.1, 4.3, 5.2 and 6.2. Their commit ids, pass counts and timings have no such mark. Please mark them the same way, and keep those rows open until a reviewer reads the repository.
New in revision 4:
- The fence (lines 568-578). The backend first sees a write when the engine calls it, and the engine resolves the key info before that call. Main's
UpdateTableinvalidates the key-info cache after the backend returns (crates/engine/src/update_table.rs, line 281). So a counter in the backend misses a write that resolved the old key info and hasn't reached the backend yet. The backend also can't tell when the invalidation ran. Lines 569-571 say thatUpdateTablebuilds and backfills before it returns. But lines 561-564 and row 2.4 say that the reconciler does it, and that index DDL never runs on the request path. Line 574 lets the GSI worker flip the index without saying that it waits and backfills first.tests/test_gsi_fence.pyraces four writers against the create, and two backfills with no wait can pass that test too. Please state one order in all three places, and describe the wait through events that the backend sees. Please also restore revision 3's test. It holds a write with key info from before the invalidation until the second backfill passes its item. Please hold a reindex reconciler write the same way. Revision 3's fence also waited for the reindex reconciler's own writes (its lines 555-557). Revision 4 doesn't say whether the fence still waits for them. - The commit-point hold (lines 775-780) freezes a query engine at a moment that isn't tied to any transaction's state. "Never passed a number whose record appeared later" also holds when no record appeared later. Please make each run fail unless a transactional read of a token shows a transaction committed while one of its records is still staged. Please also report how many numbers
txn_peekresolved during the freeze. - The hot-key observation (lines 1274-1278). The figure of 5,961 refusals against 4 acknowledged writes doesn't tell two kinds of refusal apart. Some may have met an in-flight transaction's lease, and some the lease of a transaction that had already answered. So it doesn't show DynamoDB's priority for the transaction. Please describe it as this backend's behaviour, or measure DynamoDB under the same load.
Please also fix these smaller ones:
- Row 3.5 (line 1139) is closed without the test that revision 3 named: a
PutItemthat creates an absent key during aTransactGetItems. The new test creates the key with aTransactWriteItems. Point 5 still allows thePutItemcase on a stream-enabled table. - Engineering item 2 (line 1225) names
LATESTonly. Lines 771-772 state the rule forAT_TIMESTAMPtoo. - The two new measurements (lines 711-716 and 1078-1083) don't say which durability level they ran at. The 503 below the memory quota and the two timeout answers have no test.
- Row 6.3 (line 1168) still says "or marked OPEN with its engineering item", and revision 4 marks no row OPEN.
- Line 658 still says the flag's cost "is measured before FCP", next to the measurement.
- These smaller ones from round 3 are unchanged:
- the lease's durability and key length (lines 617-620)
- the stream reader's read by key, the
txtimeoutclock and the skip marker (lines 751-766) - the counter per key-info generation (line 568)
- the index budget's lock, the
CREATINGindexes and the TTL term (lines 931-944) - open item 1's live test, and the 503 counts in open item 12
- a TransactWriteItems without
ClientRequestToken - line 222 against lines 306-308, and lines 266-267 against ADR-0023 decision 4
- rows 1.1 and 1.2 (lines 1114-1115)
- the PR description and #1183
This note isn't a condition, because revision 3 had the same text. A TransactWriteItems that ends without a commit leaves its leases until their 10 s expiry (line 619). It ends that way when it can't take a lease in 2 s or when a condition fails. It also ends that way on a rollback, and when its txtimeout expires before the commit point. Until the leases expire, the backend refuses plain writes on those items with TransactionConflictException. In DynamoDB's transactions guide, a plain write conflicts only with an ongoing TransactWriteItems that includes the same item. Deleting the leases on every path that ends the transaction would stop those refusals.
|
Revision 4 is on the branch. Since revision 3 the engineering items it listed have been implemented and merged in the reference repository (commits The test you asked for in round 2 (items 2 and 5) ran on the three-node Docker harness: one node's query engine is frozen for 60 s, longer than the stream gap grace, under three transaction writers, two plain writers and a stream reader on one table. Over two runs, 1,646 and 2,816 transactions committed, the balance sum was conserved, every acknowledged plain update and every acknowledged transaction was applied, plain writes answered only 200 or Also measured: Two Still pending, and said so in the RFC: the upstream multi-part RANGE tests, which need the pin past #381 (the in-tree port); the performance-cluster figures; the measured shared-tier bound (unresolved question 1). The repository invitation to your account is still pending at https://github.com/couchbaselabs/extenddb-couchbase/invitations. |
Lines >= 700 only: lease on every table (flag removed), skip-marker and unknown-outcome rules, no-token COMMIT, memory-quota answer, stream reader, index budget incl. TTL, rows 1.1/1.2/2.4/3.5/4.1/4.3/5.2/6.2 marked OPEN with [ref-repo], engineering items restated with what ran and what did not, Q3. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Thank you for round 4. Revision 5 is on the branch (RFC head Defects I found and fixed while answering. Five of them were mine, and they change what you should read in the text:
Smaller items
Your closing note. A Still open (the same list as line 3 and row 6.3):
Commits. The round-4 branch is
|
LeeroyHannigan
left a comment
There was a problem hiding this comment.
Thanks for revision 5 and for the reply point by point. I read it at 527f4ca against main at d9c587d.
Revision 5 resolves the Blocking point: the transactional flag is gone, and every plain write takes the lease. Points 3, 4, 5, 6, 8, 9, 10, 11 and 14 are resolved in the text, and so are most of the smaller items. The inline comments give the corrections that remain. Point 2 is resolved for the CAS-pinned actions, and item 15 covers the rest. Point 7 is answered the second way that round 4 offered: row 4.1 states the bound and the 503. The comment on line 1291 is about what the lease on every table now does to that bound. Points 12 and 13 stay open, as your reply says.
Five inline comments need a change to the design or its tests: lines 594, 611, 705, 1291 (the first of the two) and 1386. The others are smaller corrections.
Two things that don't fit inline:
- The description puts the commit-point hold under item 13. In the RFC, item 13 is the multi-part RANGE tests only. #1183 gives the key as
<table_id>#<pk_enc>|<sk_enc>, but the RFC escapes each component (line 448). #1183 also says that the divergences are recorded indocs/differences-from-dynamodb.md. But row 4.1 says those rows come with the implementation PR, and main's file has no Couchbase entry yet. - Rows 2.4, 3.5, 4.1, 4.3, 5.2 and 6.2 stay OPEN until a reviewer can read the reference repository, as line 3 says.
| server then runs the fenced second pass: it sleeps the catalog freshness window | ||
| (`EXTENDDB_CATALOG_FRESHNESS_MS`, default 2 s, plus 0.5 s), waits up to 30 s for | ||
| every write on this server that was already in flight, backfills again, and | ||
| flips the index `ACTIVE`. The server's GSI worker repeats the backfill and the |
There was a problem hiding this comment.
After a drain times out (lines 596-597), this pass backfills and flips at 75 s. The text doesn't say that it waits for the writes the drain was still waiting for. Please say that the worker's pass waits for the old generation's count to reach zero before its backfill, as the fenced pass does. Or state the longest time a write can stay in flight, and why 75 s is longer.
| per table and per generation: the fenced pass starts a new generation and waits | ||
| only for the writes counted before it, so a busy table does not hold it. A write | ||
| takes the counter before it reads its catalog view. `TransactWriteItems` (one | ||
| guard per table) and the reindex reconciler take it too; the reconciler reads |
There was a problem hiding this comment.
Line 741 says that no ExtendDB writer writes without the lease. But the reindex reconciler's rewrites (lines 593-596 and 989) take only the in-flight counter. Round 3 asked for the item's lease on both background writers, and revision 5 gives it to the backfill only (line 598). Couchbase's transactions page says that a non-transactional update made during a transaction can interfere with it or be overwritten. Please say that the reconciler rewrites each document under the item's plain lease, and what it does when it meets a transact_write or committing lease.
| the index `CREATING` for the worker's pass instead of flipping it. Each | ||
| backfilled item is rewritten under the item's `plain` lease, like any plain | ||
| write; an item that a committed transaction still holds `committing` is not | ||
| backfilled, the fenced pass then leaves the index `CREATING`, and the worker |
There was a problem hiding this comment.
A committing lease clears only when the next writer takes it over, or after 24 h (lines 672, 687-688 and 789-790). So on an item that nobody writes again, this retry keeps the index CREATING for up to 24 h. A plain write takes a committing lease over by CAS and rewrites in a query-service transaction (lines 702-706). Please let the backfill do the same, and say what it does when it meets a transact_write, transact_get or plain lease.
| ordinary writers against the create and finds every item in the `ACTIVE` index, | ||
| but it holds nothing, so a fence that waited for nothing could pass it. The held | ||
| write test, in which a `PutItem` whose key info was resolved before the publish | ||
| is parked until after the publish and must then land with the index column, |
There was a problem hiding this comment.
The held write is released at the publish. The fenced pass then sleeps the freshness window plus 0.5 s before its second backfill (lines 576-579). So the write lands before that backfill, even if the pass never waits for in-flight writes. A fence with no drain passes this test. Please hold the write past the point where a pass with no wait would run its second backfill. While the write is held, check that the index is still CREATING. Line 1376 puts the hold after the catalog-view read, and this line puts it before the publish, so please state one hold point. Please also say what the runs Tess-2 to Tess-5 are.
| at its end; a `committing` lease (a committed transaction not yet visible to | ||
| KV reads, or one whose outcome was unknown) is taken over by CAS, and the write | ||
| runs as a query-service transaction, which Couchbase orders after the committed | ||
| one, holding the lease across it and deleting it after, so the next plain |
There was a problem hiding this comment.
Lines 682-683 say that COMMIT WORK can return before every document is unstaged, and the wait at lines 684-688 covers only the CAS-pinned actions of a TransactWriteItems. This escalated write also commits through COMMIT WORK, and so does every single-item write on a stream-enabled table (lines 909-912). Both then delete their plain lease with no wait, and item 15 lists neither path. Couchbase's transactions page calls that commit eventually consistent for KV reads. So a GetItem after an acknowledged write can return the old item (RFC-0003 4.5), and the next plain write can be overwritten (4.4). Please apply the same wait on both paths, or add them to item 15 as OPEN, and correct "as after any commit" on line 786.
|
|
||
| | # | Criterion | How the backend meets it | Evidence | | ||
| |---|---|---|---| | ||
| | 4.1 | Unconditional writes never fail under contention | A bare unconditional `PutItem` with no `ReturnValues` takes the item's lease (a KV insert), makes one KV write and removes the lease (a read and a CAS remove): there is no CAS on the item and no retry of the write itself, and the last writer wins. A plain write that meets another plain write's lease retries with jittered backoff and answers 503 at the end of a 10 s bound; the lease is held for the length of one KV write, so in practice two racing calls both succeed, and one fails only if the other holds the item for more than 10 s. What a plain write answers when it meets a transaction's lease is under "Transactions". With `ALL_OLD` it is a CAS loop of 64 attempts / 10 s that answers 503 at exhaustion, as MongoDB does; no CAS detail is client-visible (`cas_contended`); the differences-document rows come with the implementation PR | **OPEN** until a reviewer reads the reference repository. Upstream `test_put_item_create_race.py::test_racing_puts_with_all_old_all_succeed`, `::test_racing_puts_on_a_stream_table_all_succeed`, `test_concurrency.py::test_parallel_inserts`; run against the demo stack on 2026-11-25 (upstream tests at the pin `7b828b0`): `test_put_item_create_race.py` 9 passed and `test_concurrency.py::TestAtomicCounter::test_atomic_counter` 1 passed, re-run on the final code (HEAD `7f5ae94` of the round-4 branch, single-node demo stack) `[ref-repo]`. No test drives two plain writers into the 10 s bound. CR-03 `[ref-repo]` | |
There was a problem hiding this comment.
Revision 5 puts this lease on every table, so the 10 s bound now applies to every unconditional PutItem. The row says that the lease is held for one KV write. On a stream-enabled table it is held across a query-service transaction (lines 670-671 and 909-912). After a crash, a plain lease that a write left behind blocks its key until it expires (30 s). Writes to that key can answer 503 until then. RFC-0003 4.1 says that two concurrent unconditional PutItem calls must both succeed. Please let plain writes share the lease, so that only a transaction excludes them (round 4's first option). Or state both cases in this row and in the differences rows.
|
|
||
| | # | Criterion | How the backend meets it | Evidence | | ||
| |---|---|---|---| | ||
| | 4.1 | Unconditional writes never fail under contention | A bare unconditional `PutItem` with no `ReturnValues` takes the item's lease (a KV insert), makes one KV write and removes the lease (a read and a CAS remove): there is no CAS on the item and no retry of the write itself, and the last writer wins. A plain write that meets another plain write's lease retries with jittered backoff and answers 503 at the end of a 10 s bound; the lease is held for the length of one KV write, so in practice two racing calls both succeed, and one fails only if the other holds the item for more than 10 s. What a plain write answers when it meets a transaction's lease is under "Transactions". With `ALL_OLD` it is a CAS loop of 64 attempts / 10 s that answers 503 at exhaustion, as MongoDB does; no CAS detail is client-visible (`cas_contended`); the differences-document rows come with the implementation PR | **OPEN** until a reviewer reads the reference repository. Upstream `test_put_item_create_race.py::test_racing_puts_with_all_old_all_succeed`, `::test_racing_puts_on_a_stream_table_all_succeed`, `test_concurrency.py::test_parallel_inserts`; run against the demo stack on 2026-11-25 (upstream tests at the pin `7b828b0`): `test_put_item_create_race.py` 9 passed and `test_concurrency.py::TestAtomicCounter::test_atomic_counter` 1 passed, re-run on the final code (HEAD `7f5ae94` of the round-4 branch, single-node demo stack) `[ref-repo]`. No test drives two plain writers into the 10 s bound. CR-03 `[ref-repo]` | |
There was a problem hiding this comment.
The row names test_concurrency.py::test_parallel_inserts as evidence, but the run it reports is TestAtomicCounter::test_atomic_counter, which is row 4.4's test. test_parallel_inserts writes a distinct key from each thread, so it doesn't put two writers on one key either. Please name the test that races bare puts on one key, and report its run.
| The items revision 3 listed as open, with their state in the reference | ||
| repository (commits on its `main`, dated 2026-11-25 UTC, are marked | ||
| `[ref-repo]`; work on the round-4 branch that is not yet pushed is described | ||
| without a commit id, and each row says what ran and what did not): |
There was a problem hiding this comment.
These lines say that work on the round-4 branch is described without a commit id. But items 1, 4 and 8 and row 4.1 cite bb94b2c, a44e465, d75f669 and 7f5ae94 from it. Line 97 says the branch is not pushed, and your reply says it is a branch of the repository that is not merged. Please say which it is, and either keep the ids with the mark (d75f669 in item 8 has none) or drop them.
| | 10 | CAS exhaustion answers 503; the `docs/differences-from-dynamodb.md` rows | The out-of-tree loops already answered 503 (`cas_contended`); revision 3's text was wrong. The rows come with the implementation PR, with the hot-key observation under Drawbacks | | ||
| | 11 | The hashed-key read compares the stored encoded keys; a partition key containing `\|S#` in the separator-collision test | Implemented (`b0c272f` `[ref-repo]`) | | ||
| | 12 | The lease cost and the hot-key refusal counts | Not measured with the lease on every table: the one-node figures of revision 4 predate it and are withdrawn. The multi-node YCSB workload A figures (at `durability = majority`) and the refusal counts (plain writes acknowledged, `TransactionConflictException` and 503, with the transaction side split the same way) are a condition of FCP. `scripts/txn-commitpoint-test.py` `[ref-repo]` prints the plain writers' answers, but its transaction side merges 503 into cancellations and a run that includes the freeze is not a steady state, so a run without a freeze and with the split counters is needed. RFC-0003 4.1, 4.3 and 4.4 are reported against those counts when they exist | | ||
| | 13 | `tests/test_gsi_multi_range_query.py` on `main` (60 cases at `f49c5f82`) against the per-part columns, with `couchbase` not in `FIRST_RANGE_ONLY_BACKENDS` | **OPEN**, blocked on the pin: the engine at `7b828b0` predates `f49c5f82` (which adds `resolve_multipart_with`) and refuses a multi-condition Query on a one-HASH, several-RANGE GSI before the backend sees it. Done when the pin is at or after `f49c5f82`, the suite passes with 60 passed, 0 skipped and 0 failed on the three-node harness `[ref-repo]`, and the engine revision and the count are recorded here | |
There was a problem hiding this comment.
tests/test_gsi_multi_range_query.py collects 64 tests at f49c5f82 and on main today. This item and row 2.8 say 60. Its TestFirstRangeOnlyBackends case skips itself on a backend that serves every RANGE attribute, which is the state this item describes. So the target here and in row 2.8 can't be met as written. Please make it 63 passed, 1 skipped and 0 failed, out of 64.
| | 12 | The lease cost and the hot-key refusal counts | Not measured with the lease on every table: the one-node figures of revision 4 predate it and are withdrawn. The multi-node YCSB workload A figures (at `durability = majority`) and the refusal counts (plain writes acknowledged, `TransactionConflictException` and 503, with the transaction side split the same way) are a condition of FCP. `scripts/txn-commitpoint-test.py` `[ref-repo]` prints the plain writers' answers, but its transaction side merges 503 into cancellations and a run that includes the freeze is not a steady state, so a run without a freeze and with the split counters is needed. RFC-0003 4.1, 4.3 and 4.4 are reported against those counts when they exist | | ||
| | 13 | `tests/test_gsi_multi_range_query.py` on `main` (60 cases at `f49c5f82`) against the per-part columns, with `couchbase` not in `FIRST_RANGE_ONLY_BACKENDS` | **OPEN**, blocked on the pin: the engine at `7b828b0` predates `f49c5f82` (which adds `resolve_multipart_with`) and refuses a multi-condition Query on a one-HASH, several-RANGE GSI before the backend sees it. Done when the pin is at or after `f49c5f82`, the suite passes with 60 passed, 0 skipped and 0 failed on the three-node harness `[ref-repo]`, and the engine revision and the count are recorded here | | ||
| | 14 | The lint item 6.2 | Done (`b0c272f` `[ref-repo]`) | | ||
| | 15 | The visibility wait covers every action of a `TransactWriteItems`, and the unknown-outcome token read sees a committed token | **OPEN**, code changes not yet made. After a commit the backend deletes the `committing` leases only once a KV read shows the committed body, but it waits only for the actions that pin a document by CAS (a conditional or pinned write or delete); an unconditional `Put`, a create, an unconditional `Delete` and a `ConditionCheck` are not waited on. After an unknown-outcome commit the token is read by KV, which can miss a token that is committed and not yet unstaged; the request then answers 500 although it committed, and a retry with the same token resolves it | |
There was a problem hiding this comment.
The status line, the acceptance intro and row 6.3 call this item "Gaps A and B", but nothing says which gap is which. Please letter the two gaps here, and add the two commit paths from the comment on line 705 to the visibility gap. Please also mark OPEN, on this item, the acceptance rows that each gap leaves unmet. The visibility gap reaches rows 4.4 and 4.5. Please say what closes each gap.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Thank you for round 5. You resolved the Blocking point (the flag is gone and every plain write takes the lease) and points 3, 4, 5, 6, 8, 9, 10, 11 and 14, and you said points 12 and 13 and the six reference-repository rows (2.4, 3.5, 4.1, 4.3, 5.2, 6.2) stay open. They do. Revision 6 is on the branch (RFC head What changed beyond your comments (so you read it, not find it):
Inline comments
The two things you raised in your summary
Still open (the same list as lines 3-11 and row 6.3 of the RFC):
Commits. All ids are in the private reference repository. The round-4 branch is
|
…-6 code, Gap A/B stay open) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Raju Suravarjjala <raju@couchbase.com>
|
@LeeroyHannigan, revision 7 is now up (52cf768), and with it I correct parts of revisions 5 and 6 and of my last reply. What was wrong. Two statements were wrong, my answers to your lines 594 and 600 repeated one of them, and my answer to your line 705 was incomplete.
The code behind revision 6 also had three defects that revision 6 did not state, now fixed: a restore target was The reference implementation is pre-release and private. I withdraw the statements above; revision 7 replaces them. Each of your round-5 points, after revision 7. The verdicts are FIXED-TEXT, FIXED-CODE, ANSWERED or OPEN. Sections are revision 7's. Code is in
Measured, not yet proven
Still open
Where the code is. All of this is one commit, |
…, not 8.0.4) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Raju Suravarjjala <raju@couchbase.com>
LeeroyHannigan
left a comment
There was a problem hiding this comment.
Thanks for revisions 6 and 7, and for the two replies. I read the RFC at 3ed5490 against main at 5489d29.
Revision 7 resolves most of round 5. That covers the comments on lines 579, 594, 600, 611, 705, 717, 741, 762 and 913. It also covers lines 1210, 1275, 1368 and 1384, both comments on line 1291, and the three items in the round 5 summary. The inline comments give what is left on some of them. The comments on lines 889 and 1386 stay open, as your replies say. If A1 and A2 hold, the corrected takeover rule closes the write skew that your second reply reports.
Five inline comments need a change to the design, its tests or the access route: lines 28, 909, 965, 1343 and 1850. The others are smaller corrections.
One point doesn't fit inline. #1183 lists two behaviours as divergences: a table being restored is hidden from the data plane, and DeleteTable on it answers ResourceInUseException. AWS's DeleteTable reference gives ResourceInUseException for a table in CREATING, and ResourceNotFoundException for a resource that is not ACTIVE. So both match the service. Please drop them from the list, or say what differs.
| resolved as committed), and a `committed` lease lapses 30 s after it is | ||
| written, which is 30 s after `COMMIT WORK` answered on the post-commit | ||
| arm and 45 s after it on the timed-out-wait arm. Once it has lapsed, the | ||
| next plain write or background rewrite clears it with no settle and takes a |
There was a problem hiding this comment.
A committed lease lapses 30 s after it is written. Couchbase's SDK docs say that the cleanup finishes a commit that did not finish unstaging "usually within a minute" (error handling, cleanup). A post-commit failure writes committed, and it is the case that leaves the unstaging to that cleanup. So a KV write after the lapse can be overwritten, which RFC-0003 4.4 rules out. A settle first does not help a ConditionCheck item, because its restaged image is identical. Please have any writer that clears a committed or committing lease, live or lapsed, write through a query-service transaction.
| `committed`. On a post-commit failure the leases are rewritten `committed` | ||
| and success is answered at once, with no visibility wait (Gap A, engineering item 15). A | ||
| `ConditionCheck` restages its identical image, so no body comparison can | ||
| show it unstaged; on a successful commit it is unstaged before the leases |
There was a problem hiding this comment.
After a successful COMMIT WORK, this deletes a ConditionCheck item's lease with no check, because no body comparison can show it unstaged. Line 947 says that the premise, COMMIT WORK answering only after the unstaging, is not from Couchbase's documentation. The transactions page calls the commit eventually consistent for KV reads. The SDK can report a success with unstaging_complete false. If that happens here, the next plain write lands on a staged document, and the cleanup can overwrite it. Please keep this lease committed after every commit, as the token arm at line 1186 already does. Otherwise, please list the case in item 15 as OPEN against row 4.4.
| lease wait; the 64 attempts belong to the CAS loops), and the write answers 503 | ||
| at its end; a `committing` lease before its `commit_by` is waited on the | ||
| same way, and at the 10 s deadline the write answers | ||
| `TransactionConflictException`, since a transaction is ongoing for the item; |
There was a problem hiding this comment.
In this revision, a stream-table write and an escalated write also mark their lease committing (lines 985-990). So a second PutItem that meets one of them answers TransactionConflictException after 10 s, although no transaction holds the item. Row 4.3 says that plain-writer contention never surfaces as a transaction conflict. Please record in the lease whether a transaction holds it, and answer 503 when none does. Or state this case in rows 4.1 and 4.3.
| pass, and once it has passed the read is cancelled the same way. Every return | ||
| path of the section that holds the leases deletes them, and the section runs | ||
| detached, so a client that drops the request still releases them; a panic inside | ||
| the detached section skips the release and the leases lapse at their 10 s expiry |
There was a problem hiding this comment.
Now that the read renews its leases, the 10 s lapse after a panic holds only if the renewal stops with the section. Please say that the renewal stops on every exit path, a panic included, here and for TransactWriteItems at line 1023.
| commit point passed but the item does not settle (its unstaging stuck, for | ||
| example after a node failure), every taker's settle fails (503 for a plain | ||
| write, a skip for a background rewrite) only while the lease is live. In | ||
| that case the lease is `committed` (written after a post-commit failure, a |
There was a problem hiding this comment.
This says that the lease is committed whenever the commit point passed and the item does not settle. After an unknown outcome that no token resolves, the lease stays committing. Then a stuck unstaging blocks every writer of the item for up to the 24 h expiry, as line 723 says for the backfill. Please name both cases and both bounds here.
|
|
||
| **Runs behind revision 7.** Every row is `[ref-repo]`. The code behind | ||
| revision 7 is pushed as the single commit `bf67ee2`; its backend and tests | ||
| are the same as the fix-branch commit `3988255`, called "the final code" |
There was a problem hiding this comment.
The unit tests (341, and 345 with fault-hooks) and the rewritten backfill test ran on 3988255. The text says only that bf67ee2 is pushed. A reviewer with access can check that the two have the same backend and tests only if both are readable. Please say whether 3988255 is pushed, or cite runs on bf67ee2.
| |---|---|---| | ||
| | Upstream `tests/test_*.py` at the pin `7b828b0`, same exclusions as under "Evidence" | single node | 1,214 passed, 6 failed, 16 skipped, 1 xfail, and 2 deselected (the two `test_gsi_async.py` tests that drive the host CLI, deselected by the runbook); 1,237 ran, 3 more than the baseline's 1,234, which is not yet traced; the 6 are the four `aws:SourceIp` loopback cases and the two `test_stream_table_reuse.py` cases of the baseline, and nothing else failed | | ||
| | Upstream `tests/python/` (parity) | single node | 331 / 331 | | ||
| | Upstream `tests/test_transact_absent_item_isolation.py` (the write-skew test) | three nodes | 10 runs, 5 of 5 tests passed in each, 5.5 to 12 s per run | |
There was a problem hiding this comment.
These rows don't name the suite revision, and row 6.3 says every conformance figure does. On main, this file has six tests (the sixth came with #513 on 5 Nov), and tests/test_transact*.py has 95 test functions, against 5 and 63 here. Please name the suite revision in each row. Please also list this file in row 4.3's evidence, since it is the test that caught the write skew. Its target for the port is 6 of 6 on main.
|
|
||
| | # | Criterion | How the backend meets it | Evidence | | ||
| |---|---|---|---| | ||
| | 4.1 | Unconditional writes never fail under contention | A bare unconditional `PutItem` with no `ReturnValues` takes the item's lease (a KV insert), makes one KV write and removes the lease (a read and a CAS remove): there is no CAS on the item and no retry of the write itself, and the last writer wins. **This differs from RFC-0003 4.1** ("two concurrent unconditional `PutItem` calls both succeed"), and the two cases are stated separately. (1) Between plain writes on a table without a stream: the second waits on the first's lease with jittered backoff and answers 503 at the end of a 10 s bound; the lease is held for one KV write, so in practice two racing calls both succeed, and one fails only if the other holds the item for more than 10 s; a plain write that crashed leaves its lease until it expires (30 s), and writes to that key can answer 503 until then. (2) On a stream-enabled table the lease spans a query-service transaction (up to `txtimeout` plus 20 s): the same 10 s bound and 503 apply to a writer that waits on it, and a crashed holder blocks its key for that long. Both are recorded in the `docs/differences-from-dynamodb.md` rows that the implementation PR adds (`main` has no Couchbase entry yet). Sharing the lease between plain writers, so that only a transaction excludes them, is the alternative; it is a follow-up if the reviewers prefer it. What a plain write answers when it meets a transaction's lease is under "Transactions". With `ALL_OLD` it is a CAS loop of 64 attempts / 10 s that answers 503 at exhaustion, as MongoDB does; no CAS detail is client-visible (`cas_contended`) | **OPEN** until a reviewer reads the reference repository. The tests that race bare puts on one key are in upstream `test_put_item_create_race.py` (8 writers, 15 rounds, every put must succeed): `::test_racing_puts_on_a_gsi_table_leave_only_the_final_entry`, `::test_racing_puts_on_an_lsi_table_leave_only_the_final_entry` and `::test_racing_puts_on_a_stream_table_all_succeed`, with `::test_racing_puts_with_all_old_all_succeed` for the `ALL_OLD` loop. Recorded run: the file 9 passed at the pin `7b828b0`, single-node demo stack, durability none `[ref-repo]` (a second run, 9 passed). `test_concurrency.py::test_parallel_inserts` is not evidence here (its threads write distinct keys), and `TestAtomicCounter::test_atomic_counter`, which passed 1 of 1 on the same run, belongs to row 4.4. No test drives two plain writers into the 10 s bound or a crashed lease. After a `COMMIT WORK` whose outcome is unknown, writes to its keys are unavailable until `commit_by` (50 s at the default `txtimeout`): a plain write answers `TransactionConflictException` after 10 s, a `TransactWriteItems` cancels after 2 s (see "The takeover rule"). CR-03 `[ref-repo]` | |
There was a problem hiding this comment.
RFC-0003 4.1 also says that a backend must not surface its concurrency control as a client-visible error on an unconditional write. That is the sentence the 503 differs from, so please quote it. Case (1) says that the lease is held for one KV write. But the escalated plain write (lines 982-985) holds it across a query-service transaction on any table. The TransactionConflictException for up to commit_by after an unknown commit is only in the evidence cell. Please make it a third case here and in the differences rows, as #1183 does.
| | 4.1 | Unconditional writes never fail under contention | A bare unconditional `PutItem` with no `ReturnValues` takes the item's lease (a KV insert), makes one KV write and removes the lease (a read and a CAS remove): there is no CAS on the item and no retry of the write itself, and the last writer wins. **This differs from RFC-0003 4.1** ("two concurrent unconditional `PutItem` calls both succeed"), and the two cases are stated separately. (1) Between plain writes on a table without a stream: the second waits on the first's lease with jittered backoff and answers 503 at the end of a 10 s bound; the lease is held for one KV write, so in practice two racing calls both succeed, and one fails only if the other holds the item for more than 10 s; a plain write that crashed leaves its lease until it expires (30 s), and writes to that key can answer 503 until then. (2) On a stream-enabled table the lease spans a query-service transaction (up to `txtimeout` plus 20 s): the same 10 s bound and 503 apply to a writer that waits on it, and a crashed holder blocks its key for that long. Both are recorded in the `docs/differences-from-dynamodb.md` rows that the implementation PR adds (`main` has no Couchbase entry yet). Sharing the lease between plain writers, so that only a transaction excludes them, is the alternative; it is a follow-up if the reviewers prefer it. What a plain write answers when it meets a transaction's lease is under "Transactions". With `ALL_OLD` it is a CAS loop of 64 attempts / 10 s that answers 503 at exhaustion, as MongoDB does; no CAS detail is client-visible (`cas_contended`) | **OPEN** until a reviewer reads the reference repository. The tests that race bare puts on one key are in upstream `test_put_item_create_race.py` (8 writers, 15 rounds, every put must succeed): `::test_racing_puts_on_a_gsi_table_leave_only_the_final_entry`, `::test_racing_puts_on_an_lsi_table_leave_only_the_final_entry` and `::test_racing_puts_on_a_stream_table_all_succeed`, with `::test_racing_puts_with_all_old_all_succeed` for the `ALL_OLD` loop. Recorded run: the file 9 passed at the pin `7b828b0`, single-node demo stack, durability none `[ref-repo]` (a second run, 9 passed). `test_concurrency.py::test_parallel_inserts` is not evidence here (its threads write distinct keys), and `TestAtomicCounter::test_atomic_counter`, which passed 1 of 1 on the same run, belongs to row 4.4. No test drives two plain writers into the 10 s bound or a crashed lease. After a `COMMIT WORK` whose outcome is unknown, writes to its keys are unavailable until `commit_by` (50 s at the default `txtimeout`): a plain write answers `TransactionConflictException` after 10 s, a `TransactWriteItems` cancels after 2 s (see "The takeover rule"). CR-03 `[ref-repo]` | | ||
| | 4.2 | Conditional writes: correct error on race | The CAS loop re-evaluates the condition against the winner's image and returns `ConditionalCheckFailedException` | CC-01, upstream `test_put_item_create_race.py::test_racing_puts_check_their_condition_against_the_winner`, `::test_racing_conditional_creates_have_one_winner` | | ||
| | 4.3 | Transaction conflict mapping | A plain write meeting a `transact_write` lease returns `TransactionConflictException`, and so does one that waits out its 10 s bound behind a `committing` lease before its `commit_by`; a transaction that meets a foreign `transact_write` lease, or cannot take its other leases in 2 s, returns `TransactionCanceledException` with `TransactionConflict` on the contended item only; a plain write meeting a `transact_get` or `plain` lease retries and answers 503 at its 10 s bound; plain-writer contention never surfaces as a transaction conflict (implemented `[ref-repo]`; see "Transactions") | **OPEN** until a reviewer reads the reference repository. TX-08 `[ref-repo]`, CC-09 `[ref-repo]`, upstream `test_transact_write_conflict.py`, `scripts/write-race-test.py` `[ref-repo]`, `tests/test_txn_lease.py` `[ref-repo]`, the three-node harness's commit-point hold `[ref-repo]` | | ||
| | 4.4 | UpdateItem serializes | CAS read-modify-write with jittered backoff; arithmetic and `ADD` never take the sub-document path; on a stream-enabled table each write is a transaction that holds the item's lease, so two on one key do not meet at the document: the second waits on the lease and writes after the first releases it, and both succeed; the first keeps its lease until its commit is visible to a KV read (`bf67ee2` `[ref-repo]`; revision 6 left this row OPEN in part because three commit paths released without that wait), and the paths that can still conflict at the document are listed under "DynamoDB Streams" | CC-02, CC-03, `scripts/concurrency-property-test.py` (`prop_add_counter`, `prop_optlock_counter`), upstream `test_concurrency.py::TestAtomicCounter::test_atomic_counter` | |
There was a problem hiding this comment.
Gap A (d) lets the cleanup overwrite a KV write made after the committed lease lapses (lines 1369-1371 and item 15). So an acknowledged UpdateItem can be lost, and RFC-0003 4.4 requires no lost update. Gap A (b) is an untested ordering on the same path. Please mark this row OPEN in part for Gap A (b) and (d). Please also name row 4.4 next to row 4.5 in the acceptance intro (line 1806), in item 15 and in the PR description.
| `couchbase:enterprise-8.0.0`, a required check as `mongodb-integration` and | ||
| `cassandra-integration` are. The crate's own `*_live_tests.rs` run there | ||
| through `run-couchbase-tests`, together with the in-crate checks every backend | ||
| runs with its own store: `metrics_conformance`, `key_conformance`, |
There was a problem hiding this comment.
Since round 5, #1523 changed AuthorizationStore on main to read a role session's data by its access key ID. It also added session_data_conformance, which the MongoDB and PostgreSQL crates run against their own stores. Please add it to this list of in-crate checks, and the new signature to the port list.
|
@LeeroyHannigan, thank you for round 6. I have read all 21 inline comments and the review body, and I am not going to answer them point by point until the changes are tested. This is a short status so you know where things stand. Wording and tables (revision 8, to follow). Most of the comments are corrections to the text, and I agree with them: the A1 and A2 statements, the Three points are code, not wording. I am implementing and testing them now, and revision 8 will describe whatever the tests show:
Line 1343 (the commit-point gate). You are right that a freeze of one query engine ends before the reader's probe, and that matches the 0 resolutions. I am trying a different fault, killing the coordinating query engine so that the unstaging is left to Couchbase's cleanup, with the same gate. If it cannot keep a record staged past the reader's age, revision 8 will say so, and the gate stays OPEN. If you have a mechanism you would accept for this, I would rather build that one. Read access (line 28). You are right that the invitation of 24 November has expired. I have sent a new read invitation to your GitHub account (2026-12-01); it is pending at https://github.com/couchbaselabs/extenddb-couchbase/invitations, and the repository answers 404 until it is accepted. It expires after seven days, and I will send another if it lapses. Rows 2.4, 3.5, 4.1, 4.3, 5.2 and 6.2 stay OPEN until a reviewer has read the repository. I expect to post revision 8 by Friday, 4 December. |
|
@suravarjjala, on line 1343: any harness meets the gate if its run shows the gate's state after the fault. In that state, a KV get misses a filler record, and a transactional read by key returns it. The run must also show that the gap reader resolves that record through its transactional read. A kill of the coordinating query engine may end like the freeze in item 15. There, another node completed the interrupted unstaging in about 1 s. If that completion comes from the Query Service's transaction cleanup, two cluster settings disable the Query Service's part in it:
If the record does not stay staged with cleanup off, please say so in revision 8. |
…mmit-point gate run, test revisions and counts) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Raju Suravarjjala <raju@couchbase.com>
|
@LeeroyHannigan, revision 8 is pushed to this PR (head Runs referred to below:
Line 1343 (your comment on the commit-point gate, and the mechanism you gave)ANSWERED. The gate was reached and the reader resolved the staged records. The row stays OPEN. You are right that a freeze of one query engine ends before the reader's probe: the unstaging takes 18 ms at the median, the reader's first transactional read comes at You asked for a mechanism, and I used yours, with one change: the kill is timed, not blind. Run G:
What it showed:
Limits, all of them of the harness: one three-node cluster; only the coordinating engine was killed, never more than one node and never a non-coordinator (the record was staged on every node anyway: KV missed it on all three); Row 5.2 stays OPEN for those limits and until a reviewer has read the reference repository. Engineering items 1 and 2 and row 5.2 in the RFC carry these numbers. Inline comments, in your line order (row 10 last)
Review body
|
LeeroyHannigan
left a comment
There was a problem hiding this comment.
Thanks for revision 8, and for the answer to each comment. I read the RFC at 4c0e275 against main at 1be1012.
Revision 8 resolves most of round 6: the comments on lines 10, 309, 845, 894, 965, 981, 1036, 1040, 1133 and 1287. It also resolves those on lines 1343, 1716, 1745, 1766, 1847, 1850, 1913 and 1974, and the two restore behaviours in #1183. The commit-point gate run is what my reply of 1 December asked for. With cleanup off, 24 of 200 trials reached the gate, and the reader resolved each staged record through its transactional read. The comment on line 904 is resolved in part (see line 1001). Line 909 is resolved in the design, with four windows left open. Line 28 stays open until a reviewer can read the reference repository, as your answer says.
The FIXED-CODE answers are in that repository, which I can't read yet, so this review checks the design the RFC states. Rows 2.4, 3.5, 4.1, 4.3, 5.2 and 6.2 stay open for that reason, as the RFC says.
Three inline comments need a change to the design or its tests: lines 1001, 1008 and 1353. The others are smaller corrections.
One point doesn't fit inline. Since #1464 merged on 2 December, main checks that a PR title is a conventional commit subject. The title becomes the subject of the squash commit. "RFC: Couchbase storage backend" fails that check: RFC is not an accepted type. The other RFC PRs use docs(rfc): ..., for example #1396 and #970. Please retitle this one docs(rfc): Couchbase storage backend.
| failure, a visibility wait that reached 15 s, an unknown outcome that the | ||
| token resolved as committed, or a clean commit with a `ConditionCheck` or an | ||
| unchanged image) and a `committing` marker (an unknown outcome that no token | ||
| resolves: no `ClientRequestToken`, or a token read that itself fails; its |
There was a problem hiding this comment.
This lists the unknown outcomes that keep a committing marker as a request without a ClientRequestToken and a failed token read. Lines 1437-1440 also keep the leases when the token is absent. There, a token that is absent now may belong to a commit still in progress. Your answer on line 904 says that a token read that finds nothing releases the leases. If the code does that, a plain write or a second transaction can go ahead while that COMMIT WORK can still pass its commit point. That is the write skew that revision 7 closed. Please keep the leases committing until commit_by for an absent token and for another fingerprint, and state that one rule here and at line 1438.
| "Global and Local Secondary Indexes" says of the backfill; the code behind | ||
| revision 7 blocked them for 30 s after a `committed` marker and then let a | ||
| plain write through by KV. That is the price of the change. No run has | ||
| produced a stuck unstaging, so how long it would block is not measured. |
There was a problem hiding this comment.
Run G produced this state. With cleanup on, the records of the six tracked trials stayed staged for 126 to 495 s (line 1663). Your answer also says that 13 visibility waits reached the 15 s bound, which leaves committed markers while documents of those transactions are still staged. So the block can be measured, and Gap A (b), which every taker now relies on, can be tested with the kill harness. Please change this sentence and lines 1029-1033 to say so. Then, in the harness, send a PutItem, an UpdateItem with ADD and a TransactWriteItems to the item of a gate trial while that trial's documents are still staged. Record each answer over time, and the item's value after the unstaging.
|
|
||
| **Limits of the round-6 code changes.** | ||
|
|
||
| - **A process death in a short window.** A taker's protection of a marker starts when it marks its own lease `committing`. Between taking a `committed` marker over and that marking, the taker's lease has only its short expiry (the transaction lease expiry for a `TransactWriteItems`, the single-write expiry for a plain write), and a request dropped while the runtime is shutting down, or a panic of the detached section, is not restored either. If the server process dies in that window, the lease expires, the next writer clears it as an ordinary expired plain lease and writes by KV, and the original document may still be staged. The window is the duration of one write and needs a process death. It is **not fixed**; the way to close it is to write the takeover lease with the 24 h expiry and the original marker in it. |
There was a problem hiding this comment.
Between a takeover and the taker's own committing mark, the marker lives only in the taker's short lease. A process death, a panic or a shutdown loses it, and the drop guard does not run while the runtime shuts down (line 1129). The next writer then writes by KV onto a document that may still be staged. The cleanup can then overwrite that acknowledged write, which RFC-0003 4.4 rules out. This bullet already names the fix. Please make it the design. The taker's lease would carry the original marker with the 24 h expiry. Every writer would then treat an expired lease that carries a marker as that marker.
| conditional write that loses every attempt to other plain writers answers | ||
| 503 `ServiceUnavailable`, which the SDKs retry, as the MongoDB backend does | ||
| after its 50 attempts; `TransactionConflictException` is answered only when the | ||
| item is held by a `TransactWriteItems` lease, or by a `committing` lease that |
There was a problem hiding this comment.
Since change (C), a committing lease that no client transaction holds ends the wait in 503, as lines 653-656 and 1109-1115 say. This sentence still gives TransactionConflictException for every committing lease that can't be taken over yet. Please limit it to a committing lease whose txn is true or absent.
| taker that puts a marker back (after a failed settle, or because its own | ||
| transaction committed nothing) restores it as it was, with its original | ||
| `exp` and the native expiry it had left (at least 60 s, at most 24 h), so | ||
| a restore does not move the marker's `exp`, though a lapsed marker is kept for at least 60 s after each touch, and a clean commit that proves nothing (a `ConditionCheck` or an identical image, also over a taken marker) writes the marker again with a fresh 24 h. |
There was a problem hiding this comment.
A restore keeps a lapsed marker for at least 60 s after each touch. So while an unstaging is stuck and writers keep arriving, the marker never expires, and the item is refused past 24 h. Lines 1003-1004, 1194, 1356 and row 4.4 give 24 h as the bound. Please state the bound as 24 h, and after that for as long as a writer touches the marker at least once every 60 s.
| on that item, a plain write answers 503 with nothing written, a background | ||
| rewrite skips the item). Every taker writes through a query-service | ||
| transaction, which Couchbase orders after the committed one, and none clears | ||
| a marker and then writes by KV: a plain write, a stream-table write, the GSI |
There was a problem hiding this comment.
The TTL sweeper also writes items, through the normal delete path (line 1734). Please name it in this list and at line 1202. A reader can then see that it takes the lease and treats a marker as a plain write does.
| on a single node at `durability = none`, where the write skew of | ||
| "Corrections in revision 7" did not show; on three nodes only the | ||
| transaction files, the write-skew test, the skew driver and the checks below | ||
| ran. The full suite on three nodes has not been run (**OPEN**). Several |
There was a problem hiding this comment.
This sentence says that the full suite on three nodes has not been run, and marks it OPEN. Line 2151 and the 389b8bc row at line 2188 report that run, and the description says the same. Please scope this sentence to the revision 7 code, drop the OPEN mark here, and point at the 389b8bc row.
| |---|---|---|---| | ||
| | 6.1 | Evaluation semantics | Delegates to `extenddb_core::expression::evaluate_condition` on the read image; no native pushdown | CR-10 to CR-13, upstream `test_conditional_writes.py`, `test_conditional_operator.py` | | ||
| | 6.2 | No hidden unused code | The crate-level `#![allow(unused_variables, unused_imports, clippy::too_many_arguments)]` of `engine.rs` and `catalog.rs` is gone, with the 3 unused imports and the 5 dead items it hid (measured 2026-11-05, removed 2026-11-24, commit `b0c272f`; `[ref-repo]`). One targeted, commented `#[allow(dead_code)]` remains, on the sidecar-format detector the proposed v3.1 → map-form data migration will call | **OPEN** until a reviewer reads the reference repository. `cargo rustc --lib -- --force-warn unused_imports --force-warn unused_variables --force-warn dead_code`: that one item | | ||
| | 6.3 | Documentation describes the system as built | Every mechanism described in this RFC is implemented and on the live code path, or is marked OPEN: rows 2.4, 3.5, 4.1, 4.3, 5.2 and 6.2 are OPEN until a reviewer reads the reference repository, and, in "Engineering items of revision 3", items 1, 2, 5, 8 and 12 have OPEN parts, item 13 is blocked on the pin and item 15 is two OPEN gaps (Gap A and Gap B, see its row, which leaves rows 4.4 and 4.5 OPEN in part); Capella is stated as unvalidated, the failover-sweep claim cites a specific nightly run, every conformance figure names its suite revision, and the scaling figures cite measured runs. Also recorded here for honesty: nightlies #46 through #58 `[ref-repo]` reported a **baseline** sweep of 908 of 913 with the same 5 non-passes every run (`test_abac.py` ×3, `test_auth_permissions.py::test_explicit_deny_all_service_operations`, `test_cross_account_isolation.py::TestStreamAccountScoping::test_shard_iterator_only_returns_owning_account_records`). Triaged 2026-11-09 as test-suite skew: the nightly's heavy lane skipped the "clone upstream at the pinned rev" stage, so the sweep ran the stale `e41f370` test checkout (913 collected) against the auth-cluster build. What the pinned `7b828b0` run of 2026-11-24 (under "Evidence") shows: the `test_auth_permissions.py` and `test_cross_account_isolation.py` cases pass, and three `test_abac.py` cases fail, all three `aws:SourceIp` loopback cases, behind Docker Desktop's bridge on the machine that ran it. Whether the nightly's three `test_abac.py` non-passes were those cases, and whether they pass on the Linux agent, is settled by the first nightly after couchbaselabs/extenddb-couchbase#237 `[ref-repo]` (merged 2026-11-24: the clone stage runs in both lanes and `scripts/sweep-under-failover.sh` refuses a checkout that does not match the Cargo pin); until then the skew triage covers two of the five, not all five | Jenkins `extenddb-couchbase-nightly` #51 console `[ref-repo]`; #237 `[ref-repo]`; the pinned run under "Evidence" | |
There was a problem hiding this comment.
Row 6.3 says that every conformance figure names its suite revision. The six-test copy at line 2172 and the files at lines 2173 and 2185 say that the revision was not recorded. The parity row at line 2130 names none. Please let 6.3 say "names its suite revision or says that it was not recorded", and name the pin in the parity row.
| cleanup off the log shows resolved lines for the staged numbers; the first | ||
| resolution came 16.0 to 16.4 s after the kill, which is `txtimeout` plus 15 s, | ||
| and the reader then delivered all 10 records of the trial while a KV get still | ||
| missed the staged ones. The 1 s young-gap rule never fired wrongly: no number |
There was a problem hiding this comment.
"The 1 s young-gap rule" appears only here, and the reader's rules at lines 1538-1549 name no such rule. Please define it there: what the 1 s is, and what the reader does with a gap younger than it. Otherwise, please drop the clause and keep the sentence after the colon.
| it, tip `b66f6c7` `[ref-repo]`, pushed to the private repository (the | ||
| lease changes are in `5a14ccf` to `823f7e8` and `8d941da` (a test change); `e2fa27f` adds the | ||
| identical-image rule for single-item writes, `1c44cc6` the commit-point | ||
| harness, `389b8bc` one test, and `b66f6c7` the rename of the harness |
There was a problem hiding this comment.
The description names two rename commits, d0dc673 and b66f6c7, but this list gives b66f6c7 as the only change since the runs below. Please add d0dc673 here and at line 1687.
…, exact-enough comparison, staged-key runs, single-item write ends its own lease) Answers the round-7 review. The RFC text now states the lease a taker writes when it takes a marker over (it carries the original marker), the rule for an unknown COMMIT WORK, the 4-ulp comparison used by the taker's settle, the visibility wait and the identical-image rule, the single-item write whose own task ends its lease, the staged-key and number-change probes of the commit-point gate harness, the stream reader's dependence on assumption A1, and the new costs and limits. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Raju Suravarjjala <raju@couchbase.com>
|
@LeeroyHannigan, thank you for the review of revision 8 and for the line-by-line check of it. Revision 9 is pushed to this PR (head What changed since revision 8, in the code at
What was not done, stated plainly: a real change of up to 4 ulps is still taken as unchanged by the comparison, and an exact comparison is not a fix, so that residual stays OPEN (Gap A (b) and (e)); a panic hook, a SIGTERM test, a test of a restore that fails twice and a live chained takeover are not written, so those two windows are closed by design and SIGKILL tested only; the control at Inline comments, in your order
Review body
|
…g taken has no guard) The text said a request dropped before its first transaction ends the lease. That holds only once the lease is taken: the drop guard is created after the lease write returns, so a request dropped while that write is in flight leaves the lease for its full life (50 s at the default txtimeout). Stated as an open residual in the takeover rule, Drawbacks (5) and the status lines; no line numbers move. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Raju Suravarjjala <raju@couchbase.com>
|
@LeeroyHannigan, a correction to my reply above, in the text only. The RFC head is now The revision-9 text says a request dropped by its client ends the lease when no transaction is in flight ("the request died before its first transaction"). That holds only once the lease has been taken. The drop guard is created after the lease write returns, so a request dropped while that write is in flight leaves the lease for its full life, 50 s at the default |
LeeroyHannigan
left a comment
There was a problem hiding this comment.
Thanks for revision 9, and for the answer to each comment. I read the RFC at 61f1df5 against main at b3510a9, then your correction at 0668121. The correction changes 8 lines and moves none of the lines below. It names an open window: a request dropped while its lease write is in flight. The takeover rule, Drawbacks item (5) and the status lines now state that window, as your comment says.
The three conditions of round 7 are met:
- Line 1001: every unknown outcome now keeps the leases
committinguntilcommit_by. Only a token with this request's fingerprint proves that the commit point passed. - Line 1008: the RFC now gives the measured staged times. The kill harness sent a
PutItem, anADDand aTransactWriteItemsto items whose own document was still staged, and 51 of 51 tracks were consistent. - Line 1353: the taker's lease now carries the original marker, written in the same CAS that takes the marker over.
Revision 9 also resolves the comments on lines 638, 935, 1082, 2363, 984, 962, 2124, 2281, 1673 and 165. The new title passes main's title check.
One change before I approve: the 4-ulp comparison on line 1299. With it, the taker's settle can still pass on the pre-commit image. The reason given for keeping a tolerance doesn't hold against line 1344. The other inline comments are smaller corrections.
The description and your answer put the 4-ulp residual in Gap A (b) and (e). Row 4.4 and item 15 say that (e) is closed, and they put the residual under (b). The revision 8 section of the description also calls (e) closed. Please make the three agree. The RFC's version, (b) only, reads right to me.
The code answers are still in the reference repository, which I can't read yet. So rows 2.4, 3.5, 4.1, 4.3, 5.2 and 6.2 stay open, as the RFC says.
| statement of revisions 8 and 9 that this carried no loss of safety, because every | ||
| pair the wait calls equal also keeps its lease `committed`, was wrong for the | ||
| taker: that protection hands the next writer a `committed` marker whose item may | ||
| still be staged, and the settle, with the same tolerance, could not tell. The tolerance is 4 ulps (`FLOAT_CLOSE_ULPS`, at most about 8.9e-16 relative), not zero, so a real change within it is still taken as unchanged: N `"1.0000000000000002"` to N `"1.0000000000000004"` are two valid DynamoDB numbers one ulp apart, both stored as native numbers because both round-trip through f64, and `images_match` calls them equal. For such a change the taker's settle can still pass on the pre-commit image, with the consequences described above: a condition on the number and `ALL_OLD` evaluated on the pre-commit image, and an `ADD` built on the old base, which can be lost only if the staged document's `META().cas` equals the KV cas, which no run has shown. It cannot be removed by comparing exactly, because the query service and the KV may print the same double differently (a unit test of the repository records a normalisation of about 1.7e-16 relative; no run of ours saw it live), so the tolerance is precautionary and the residual is **OPEN** (Gap A (b); it also bears on the identical-image rule of (e), which is closed for exactly identical images). The change from 1e-12 to 4 ulps closes the defect for every change larger than 4 ulps, shown live: 371 and 317 failed conditions on the old build, none on the new. What |
There was a problem hiding this comment.
With 4 ulps, a real change within the tolerance still lets the taker's settle pass on the pre-commit image. A condition, ALL_OLD and an ADD base can then come from the state the commit replaced. That is the failure the probe on 119b91f measured. The reason given for keeping a tolerance is a normalisation seen only in a unit test. And line 1344 already calls a document that stays unsettled the safe side. Please measure whether a KV read and the query service ever give a stored double different bits. Use values such as 1.0000000000000002, 5e-324 and 1.7976931348623157e308. If they don't, please compare exactly in item_unstaged, and keep images_match for the wait and the identical-image rule. If they do, please say how Query, Scan and TransactGetItems keep the exact numbers of row 1.3. All three read through the query service.
| unstaging. On the revision-8 code a single-node run (`durability = none`) | ||
| found the `committed` marker still present 35 s after it was written, the | ||
| next `PutItem` taking it over and running as a query transaction, and the | ||
| lease cleared afterwards `[ref-repo]`. The overwrite itself is not reachable |
There was a problem hiding this comment.
Round 7 asked to change this sentence as well as the one at line 1124, and it's unchanged. The kill harness now holds an item's own document staged (line 2040), and item 15 (d) calls it such a harness. Please say that here. Also say that the overwrite needs one of three open cases, and that no run produced any of them. The cases are a marker that expired, an expired taker's lease over a lapsed marker, and a mixed fleet.
| | 4.1 | Unconditional writes never fail under contention | A bare unconditional `PutItem` with no `ReturnValues` takes the item's lease (a KV insert), makes one KV write and removes the lease (a read and a CAS remove): there is no CAS on the item and no retry of the write itself, and the last writer wins. **This differs from RFC-0003 4.1**, which says: "Two concurrent unconditional `PutItem` calls on the same key must both succeed (last-writer-wins semantics). The backend must not surface internal concurrency-control mechanisms (e.g., WriteConflict, version mismatches) as client-visible errors for unconditional single-item writes." (`docs/rfcs/0003-backend-acceptance-criteria.md` on `main`.) The 503 and the `TransactionConflictException` below are the lease, which is a concurrency-control mechanism of this backend surfaced to the client on an unconditional write, so they differ from that sentence, in three cases. (1) Between plain writes on a table without a stream: the second waits on the first's lease with jittered backoff and answers 503 at the end of a 10 s bound; the lease is held for one KV write, so in practice two racing calls both succeed, and one fails only if the other holds the item for more than 10 s; a plain write that crashed leaves its lease until it expires (30 s), and writes to that key can answer 503 until then. An escalated plain write, which takes over a `committed` lease or a `committing` lease past its `commit_by` and runs as a query-service transaction on any table, holds the lease across that transaction, not for one KV write, and a plain write that waits on it meets the same 10 s bound. (2) On a stream-enabled table the lease spans a query-service transaction (up to `txtimeout` plus 20 s): the same 10 s bound and 503 apply to a writer that waits on it, and a crashed holder blocks its key for that long. (3) After a `COMMIT WORK` of a client `TransactWriteItems` whose outcome is unknown, writes to the item's keys answer `TransactionConflictException` (a plain write, after 10 s) or cancel with `TransactionConflict` (a `TransactWriteItems`, after 2 s) for up to `commit_by`, 50 s at the default `txtimeout`; after the unknown outcome of a single-item write on a stream-enabled table or of an escalated write, a plain write answers 503 after 10 s and a `TransactWriteItems` cancels after 2 s, for the same time. All three are recorded in the `docs/differences-from-dynamodb.md` rows that the implementation PR adds (`main` has no Couchbase entry yet). A fourth point belongs to row 4.3 as well: a stream-table write and an escalated write mark their own lease `committing` before `COMMIT WORK`. In the code behind revision 7 the lease did not record whether a client `TransactWriteItems` or such a write holds it, so a second `PutItem` that met it and was still waiting at 10 s answered `TransactionConflictException` although no transaction held the item, a divergence from 4.1 and from the sentence of row 4.3 that plain-writer contention never surfaces as a transaction conflict. In the revision-8 code the lease records it (`txn`), and that second `PutItem` answers 503 at 10 s; a client transaction's own `committing` lease still gives `TransactionConflictException` (case 3), and a lease with no `txn` field, written by an older binary, is read as a transaction's. Sharing the lease between plain writers, so that only a transaction excludes them, is the alternative; it is a follow-up if the reviewers prefer it. What a plain write answers when it meets a transaction's lease is under "Transactions". With `ALL_OLD` it is a CAS loop of 64 attempts / 10 s that answers 503 at exhaustion, as MongoDB does; no CAS detail is client-visible (`cas_contended`) | **OPEN** until a reviewer reads the reference repository. The tests that race bare puts on one key are in upstream `test_put_item_create_race.py` (8 writers, 15 rounds, every put must succeed): `::test_racing_puts_on_a_gsi_table_leave_only_the_final_entry`, `::test_racing_puts_on_an_lsi_table_leave_only_the_final_entry` and `::test_racing_puts_on_a_stream_table_all_succeed`, with `::test_racing_puts_with_all_old_all_succeed` for the `ALL_OLD` loop. Recorded run: the file 9 passed at the pin `7b828b0`, single-node demo stack, durability none `[ref-repo]` (a second run, 9 passed). `test_concurrency.py::test_parallel_inserts` is not evidence here (its threads write distinct keys), and `TestAtomicCounter::test_atomic_counter`, which passed 1 of 1 on the same run, belongs to row 4.4. No test drives two plain writers into the 10 s bound or a crashed lease. After a `COMMIT WORK` whose outcome is unknown, writes to its keys are unavailable until `commit_by` (50 s at the default `txtimeout`): a plain write answers `TransactionConflictException` after 10 s when a client transaction holds the lease and 503 when it does not, a `TransactWriteItems` cancels after 2 s (see "The takeover rule"). On the revision-8 code, `tests/test_fault_hooks.py` `[ref-repo]` (single node) holds a stream-table put at its commit and shows the second `PutItem` answering 503 after about 10 s, a held escalated put giving 503, a held client `TransactWriteItems` giving `TransactionConflictException`, and a lease with its `txn` field removed giving `TransactionConflictException`. CR-03 `[ref-repo]` | | ||
| | 4.2 | Conditional writes: correct error on race | The CAS loop re-evaluates the condition against the winner's image and returns `ConditionalCheckFailedException` | CC-01, upstream `test_put_item_create_race.py::test_racing_puts_check_their_condition_against_the_winner`, `::test_racing_conditional_creates_have_one_winner` | | ||
| | 4.3 | Transaction conflict mapping | A plain write meeting a `transact_write` lease returns `TransactionConflictException`, and so does one that waits out its 10 s bound behind a `committing` lease that a client transaction holds, before its `commit_by`; a transaction that meets a foreign `transact_write` lease, or cannot take its other leases in 2 s, returns `TransactionCanceledException` with `TransactionConflict` on the contended item only; a plain write meeting a `transact_get` or `plain` lease retries and answers 503 at its 10 s bound; plain-writer contention does not surface as a transaction conflict: a stream-table or escalated write marks its own lease `committing` before `COMMIT WORK` with `txn` false, so a second `PutItem` that waits out 10 s behind it answers 503, and a lease with no `txn` field (written by an older binary) is read as a transaction's (the revision-8 code; the code behind revision 7 answered `TransactionConflictException` there, see row 4.1) (implemented `[ref-repo]`; see "Transactions") | **OPEN** until a reviewer reads the reference repository. TX-08 `[ref-repo]`, CC-09 `[ref-repo]`, upstream `test_transact_write_conflict.py`, upstream `test_transact_absent_item_isolation.py` (the test that caught the write skew; suite at the pin `7b828b0`, 5 of 5 tests in 10 runs on three nodes; its target for the port is 6 of 6 on `main`, not run), `scripts/write-race-test.py` `[ref-repo]`, `tests/test_txn_lease.py` `[ref-repo]`, `tests/test_fault_hooks.py` `[ref-repo]` (the `txn` cases, single node), the three-node harness's commit-point hold `[ref-repo]` | | ||
| | 4.4 | UpdateItem serializes | CAS read-modify-write with jittered backoff; arithmetic and `ADD` never take the sub-document path; on a stream-enabled table each write is a transaction that holds the item's lease, so two on one key do not meet at the document: the second waits on the lease and writes after the first releases it, and both succeed; the first keeps its lease until its commit is visible to a KV read (`bf67ee2` `[ref-repo]`; revision 6 left this row OPEN in part because three commit paths released without that wait), and the paths that can still conflict at the document are listed under "DynamoDB Streams". **OPEN** in part (Gap A, engineering item 15): (b) the ordering of a takeover's query-service transaction after a committed one is untested, and every taker now relies on it (observed, not tested: the second kill-harness run followed 51 tracks whose item's own document was staged, 31 acknowledged writes by takeover, all 51 consistent; "DynamoDB Streams", "Writes onto the item of a gate trial"); (d) a plain write can still be overwritten by Couchbase's cleanup, so an acknowledged `UpdateItem` could be lost, which RFC-0003 4.4 rules out (a backend "must not return errors to the client for contention that DynamoDB handles transparently, nor silently discard a committed write"), but only in three cases: a marker that has reached its expiry (24 h, extended while a writer touches it at least once every 60 s) with unstaging still pending, the expiry of a taker's lease that carries a lapsed marker (at least 60 s) with unstaging still pending, and a mixed fleet; the two more of revision 8, a process death between a takeover and the taker's own `committing` mark and a restore that fails twice, are closed by design in the revision-9 code by the taker's lease carrying the marker (SIGKILL tested live; a panic, a SIGTERM shutdown and a restore that fails twice not tested) (the revision-7 route, a `committed` lease lapsing after 30 s, is closed in the revision-8 code, at the cost of refusing writers for 24 h, and after that for as long as a writer touches the marker at least once every 60 s while an unstaging is stuck; measured with cleanup on, the documents stayed staged for 23 to 522 s at a `txtimeout` of 30 s and 42 to 928 s, median 222 s, at 1 s); (e), a `ConditionCheck` item's lease deleted after a clean commit with no check, is closed in the revision-8 code. No acknowledged write was lost in a run, the kill-harness probes included (writes that were applied and answered 500, 2 of the first run's 12, were not acknowledged and are listed under "Writes onto the item of a gate trial") | CC-02, CC-03, `scripts/concurrency-property-test.py` (`prop_add_counter`, `prop_optlock_counter`), upstream `test_concurrency.py::TestAtomicCounter::test_atomic_counter` | |
There was a problem hiding this comment.
In the second kill-harness run, every acknowledged takeover wrote after its document unstaged. Line 2040 says "after each, the probed document was no longer staged". The settle compares integers and strings exactly, so it waited for the unstaging. The run therefore shows the refusal and the settle, and a broken write-write ordering would pass it too. Please say so here and in item 15 (b), and cite the 6 ADD samples on 119b91f for the ordering. Please also add a track whose kill transaction holds a ConditionCheck or an identical-image Put on the probed item. Then the taker's transaction meets a staged document, which is the case (b) is about.
Also on this row, "extended while a writer touches it" reads as if the marker's exp moves. The takeover rule says that the exp never moves, and that each touch keeps the lapsed marker for another 60 s. Please use its wording here.
| lease, and the first request's leases stay `committing` until `commit_by`. | ||
| That is read from the code (`engine.rs`: `ambiguous_lease_fate`, | ||
| `takeover_allowed`, `commit_by_ms`); the decision has a unit test only, and no | ||
| live test runs it, because the test hook cannot make a token invisible. So a stuck unstaging blocks every writer of the item, the plain |
There was a problem hiding this comment.
The reason given here covers only the cases that have a token. A TransactWriteItems with no ClientRequestToken has no token to hide. So a lost COMMIT WORK answer, like the one the single-item test injects (line 1440), would run this rule live. Please add that case, and check that a plain write waits until commit_by and that a second transaction cancels. Otherwise, please say that the unit test is the only cover for it too.
| says `CREATING`, but it does not change what a `Query` answers. This is a | ||
| difference from DynamoDB, and a row for it goes into | ||
| `docs/differences-from-dynamodb.md` with the implementation PR; the fix (read | ||
| the row's `IndexStatus` on an index `Query`) is not made. Only `Query` was |
There was a problem hiding this comment.
DynamoDB refuses a Scan of a CREATING index as well as a Query. The developer guide's page on managing global secondary indexes says "You can't Query or Scan the index until it is ACTIVE". Please check the index Scan path, and put both operations in the planned row. main already has the service's wording, measured for a vector index. It is VECTOR_INDEX_BACKFILLING_SCAN_PREFIX in crates/core/src/types/table.rs: "Cannot read from backfilling global secondary index: ".
| second writer still waiting after 3 s; and an old-format lapsed lease that is | ||
| cleared as before. The whole file passed (31 passed, 3 skipped at the default | ||
| `txtimeout`; 32 passed, 1 failed, 1 skipped at 1 s, the failure being the known | ||
| test that fails at that setting). One test kills the server with SIGKILL at the pause |
There was a problem hiding this comment.
With a marker that has 24 h left, this test would still pass if the taker's document got only the lease's lifetime plus 30 s. That holds as long as the restart and the next write come within that time. Please start the next writer only after both the lease's lifetime plus 30 s and 60 s pass. Then check that the taker's document is still there with its marker field.
| | # | Criterion | How the backend meets it | Evidence | | ||
| |---|---|---|---| | ||
| | 5.1 | Atomicity with data writes | Records are written in the data transaction | ST-04, upstream `test_streams.py` | | ||
| | 5.2 | Per-shard ordering | Numbers are taken before commit; `GetRecords` walks the shard in sequence order and stops at an unresolved number, which only a skip marker written after a definite failure, or a transactional read of the record after the age, resolves (see "DynamoDB Streams"), designed so that no reader passes a number whose record may still appear (implemented; the freeze hold that tests it ran twice and its gate failed both times, with 0 records resolved by a transactional read; a later run that killed the coordinating query engine with query cleanup off reached the gate in 24 of 200 trials, and 101 of the 102 `stream gap` lines in its backend log are records resolved by a transactional read; one three-node cluster, 1 s `txtimeout`, 10-put transactions; see "DynamoDB Streams") | **OPEN** until a reviewer reads the reference repository, and for the commit-point hold: its freeze runs failed the gate both times, and the run that reached it is one harness on one cluster whose harness is in the repository (`scripts/commit-point-gate/`, added in `1c44cc6` and renamed in `d0dc673` and `b66f6c7` `[ref-repo]`) only as a copy that was not rerun (see "DynamoDB Streams"). ST-03, DC-07 `[ref-repo]`, upstream `test_streams.py`; RFC-0003's stress scenario "consumer reading during concurrent writes" (RFC-0003:160, not a test in `upstream/tests/`) is covered only for gaps, by the stream reader of `scripts/txn-commitpoint-test.py` `[ref-repo]` (the three-node harness's commit-point hold: a query engine frozen 60 s, longer than the age); event types and cross-table leakage under concurrent writes are not yet tested | |
There was a problem hiding this comment.
Lines 1898-1908 now make the reader's no-skip guarantee depend on A1. They say that if A1 fails, an iterator can step over a number whose record commits later. This row and the Streams row of the design summary (line 2416) still state the guarantee without that condition. Please add "under assumption A1 (not tested, engineering item 1)" in both places.
| taker: that protection hands the next writer a `committed` marker whose item may | ||
| still be staged, and the settle, with the same tolerance, could not tell. The tolerance is 4 ulps (`FLOAT_CLOSE_ULPS`, at most about 8.9e-16 relative), not zero, so a real change within it is still taken as unchanged: N `"1.0000000000000002"` to N `"1.0000000000000004"` are two valid DynamoDB numbers one ulp apart, both stored as native numbers because both round-trip through f64, and `images_match` calls them equal. For such a change the taker's settle can still pass on the pre-commit image, with the consequences described above: a condition on the number and `ALL_OLD` evaluated on the pre-commit image, and an `ADD` built on the old base, which can be lost only if the staged document's `META().cas` equals the KV cas, which no run has shown. It cannot be removed by comparing exactly, because the query service and the KV may print the same double differently (a unit test of the repository records a normalisation of about 1.7e-16 relative; no run of ours saw it live), so the tolerance is precautionary and the residual is **OPEN** (Gap A (b); it also bears on the identical-image rule of (e), which is closed for exactly identical images). The change from 1e-12 to 4 ulps closes the defect for every change larger than 4 ulps, shown live: 371 and 317 failed conditions on the old build, none on the new. What | ||
| tests it: unit tests, 361 passed at `100eeee` and 367 at `aaaac8b` (365 and 371 with `fault-hooks`; | ||
| `a_change_of_300_ulps_is_not_equivalent` checks that `images_match`, the settle's |
There was a problem hiding this comment.
Nit: the test's name says 300 ulps, but the pair at line 1283 is about 450 ulps apart. Please say which pair the test uses.
| | 5.2 | Per-shard ordering | Numbers are taken before commit; `GetRecords` walks the shard in sequence order and stops at an unresolved number, which only a skip marker written after a definite failure, or a transactional read of the record after the age, resolves (see "DynamoDB Streams"), designed so that no reader passes a number whose record may still appear (implemented; the freeze hold that tests it ran twice and its gate failed both times, with 0 records resolved by a transactional read; a later run that killed the coordinating query engine with query cleanup off reached the gate in 24 of 200 trials, and 101 of the 102 `stream gap` lines in its backend log are records resolved by a transactional read; one three-node cluster, 1 s `txtimeout`, 10-put transactions; see "DynamoDB Streams") | **OPEN** until a reviewer reads the reference repository, and for the commit-point hold: its freeze runs failed the gate both times, and the run that reached it is one harness on one cluster whose harness is in the repository (`scripts/commit-point-gate/`, added in `1c44cc6` and renamed in `d0dc673` and `b66f6c7` `[ref-repo]`) only as a copy that was not rerun (see "DynamoDB Streams"). ST-03, DC-07 `[ref-repo]`, upstream `test_streams.py`; RFC-0003's stress scenario "consumer reading during concurrent writes" (RFC-0003:160, not a test in `upstream/tests/`) is covered only for gaps, by the stream reader of `scripts/txn-commitpoint-test.py` `[ref-repo]` (the three-node harness's commit-point hold: a query engine frozen 60 s, longer than the age); event types and cross-table leakage under concurrent writes are not yet tested | | ||
| | 5.3 | Account and table isolation | Shard id embeds the table id; records carry the table id and every read is scoped by it | upstream `test_cross_account_isolation.py` (one case in this file failed in the nightly baseline for a test-suite-skew reason, see 6.3; it passes against the pinned suite), `test_stream_table_reuse.py` | | ||
| | 5.4 | Correct event types | `INSERT` / `MODIFY` / `REMOVE` with images per view type; an unchanged item emits no record | ST-01, ST-05, upstream `test_streams.py` | | ||
| | 5.5 | Retention and cleanup | `idx_stream_ts` plus a delete at 2 |
There was a problem hiding this comment.
Nit: since the task ends the lease, the client's timeout no longer matters here. A lost COMMIT answer keeps the lease committing until commit_by either way, so please say it that way.
|
|
||
| **Writes onto the item of a gate trial** (the round-7 review's request on the takeover rule; Gap A (b)). This is the one full account of two kill-harness runs and a short third one at `aaaac8b`; the other places in this RFC point here. The first two ran the lease and takeover rules of the revision-9 branch before the comparison fix (the backend as of `493242d`, fault-hooks image) `[ref-repo]` on three nodes, `durability = majority`, with query cleanup on throughout (`queryCleanupLostAttempts` and `queryCleanupClientAttempts` true, never changed) and one table per trial. A trial is one `TransactWriteItems` on a fresh stream-enabled table; the coordinating query engine is killed with SIGKILL just after the first document of the transaction is visible by KV (Run G's trigger, with a shorter delay); a tracker then probes items of that transaction while its documents are staged, one kind of write per track (`PutItem`, `UpdateItem` `ADD cnt 1000`, or a `TransactWriteItems` of an `Update` on the item and a `Put` of a fresh key), every 1 to 2 s until the unstaging is complete, and records for each probe the time since the kill, the answer, the lease before and after, and the item by KV read and by transactional read. | ||
|
|
||
| *Second run, the one that tests a write onto a staged item document.* Harness `e94c95f` `[ref-repo]`, 40 puts per transaction, `txtimeout` 30 s (a 40-put transaction takes 20 to 25 s and does not fit a `txtimeout` of 1 s). Right after the kill the harness classifies every key of the transaction (a transactional read returns the transaction's value and a KV read does not) and follows only trials with at least one such key, up to three distinct staged keys per trial, one per write kind. In 66 trials, all 66 writers answered ok and 19 trials (29%) had an item document of their own staged; they gave 51 tracks, 17 each of `PutItem`, `ADD` and `TransactWriteItems`, and in 51 of 51 the first probe, 0.05 to 0.08 s after the kill, met the item's own staged document (staged was read just before the probe, tens of milliseconds earlier). Answers over time: the first probe of a `PutItem` or `ADD` track answered `TransactionConflictException` after 10 s (the original writer's `committing` lease) and the first of a `TransactWriteItems` track was cancelled after 2 s; later probes answered 503 (`PutItem`, `ADD`; each is the documented warning "the item's last transaction is committed but not yet visible" in the backend log) or were cancelled (`TransactWriteItems`) until a takeover of the `committed` marker acknowledged one. 12 `PutItem`, 11 `ADD` and 8 `TransactWriteItems` probes were acknowledged that way while the document had been staged just before (0.3 to 1.9 s each); after each, the probed document was no longer staged, and the backend log shows `lease takeover op=committed` followed by `lease end ... Release` for each, and no `Keep` or `Restore`. The unstaging of the kill transaction was seen complete 23 to 522 s after the kill (17 trials). After it, 51 of 51 tracks were consistent (`PutItem` left the last acknowledged value; `ADD` kept the transaction's value with a count of 1000 times the acknowledgements; `TransactWriteItems` kept its values and the fresh key), no acknowledged write was lost, no value of the transaction was overwritten, no acknowledged probe was followed by a state in which the transactional read differed from the KV read, no probe answered a status other than 200, 400 (conflict or cancelled) or 503, and the backend log of the window has no ERROR line. A control with the same harness and parameters on the revision-8 backend at `389b8bc` (release build with fault hooks, own container) gave the same: 17 trials, 7 with a staged item document, 21 tracks, 21 of 21 consistent. The kills still landed 4 to 46 ms (median 7 ms) after the first visible document, no earlier than in Run G, so the yield comes from the transaction size, not from the kill offset. Limits of this run: the backend log shows takeovers and ends but not KV operations, so the absence of any KV write onto a staged document is an absence of observation and not a proof; the late time bins (120 s and after) rest on 3 or 4 trials; at most 9 trackers ran at once; and the numbers probed are integers and strings, so a change smaller than the old float tolerance is in neither run. |
There was a problem hiding this comment.
Nit: 19 trials had a staged document of their own, but the RFC gives the unstaging time for 17. Please say what happened in the other two. Row 4.4 and Drawbacks quote "23 to 522 s" as the measured range.
…)/(b) residual, kill-harness runs, cancel-safe lease acquisition) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Raju Suravarjjala <raju@couchbase.com>
|
@LeeroyHannigan, thank you for round 8. Revision 10 is pushed to this PR (head What changed, in the code at
Inline comments, in your order
Review body
|
LeeroyHannigan
left a comment
There was a problem hiding this comment.
Thanks for revision 10, and for the answer to each comment. I read it at 9860445 against main at c057660.
The round 8 condition is met in part. item_unstaged now compares exactly, and the 4-ulp tolerance stays only in the visibility wait, the identical-image rule and single_write_txn_body. One case is still open, in how the settle parses its two reads. It is the one change I need before I approve. See the comment on line 1387. The other inline comments are smaller corrections.
Revision 10 resolves the other round 8 comments: lines 1156, 1119, 777, 1204, 2700, 1301, 2869 and 2040. On line 2692, the fourth run added the tracks I asked for. Its ConditionCheck and identical Put items met no staged document of their own, and the RFC says so and keeps (b) open in part. The RFC, the description and #1183 now give one account of (e).
The code answers are still in the reference repository, which I can't read yet. So rows 2.4, 3.5, 4.1, 4.3, 5.2 and 6.2 stay open, as the RFC says.
|
|
||
| *The measurement* (Couchbase Server 8.0.0, three nodes, `durability = majority`; the question was whether a KV read and the query service ever give a stored double different bits). It covered committed, unstaged documents only: 350 raw documents written to the bucket directly, with values such as 1.0000000000000002, 5e-324, 1.7976931348623157e308, subnormals and odd tokens (only these could carry 5e-324 and 1.7976931348623157e308, which are outside DynamoDB's range: the API refuses them with `ValidationException`); 442 documents written through the API (221 DynamoDB-valid values into a plain table and a stream-enabled table); and 140 staged writes, read after their commit. For every document a KV read and a whole-document read through the query service, inside and outside a transaction, returned the same number token and the same bits: 0 differences. The only difference between the two services was that the query service returns -0.0 as 0. The five API read paths covered different numbers of documents: `GetItem`, `Scan` and `TransactGetItems` 442 of 442; `Query` 261 (all 221 of the plain table, 40 of the 221 of the stream-enabled table); the read of a `ConditionCheck` inside a transaction (the item that a failing condition returns) 120 (the first 60 per table). Where a path was observed it returned the same number as the others: 0 disagreements; a path was not observed on the documents it did not cover. That is the answer to how `Query`, `Scan` and `TransactGetItems`, which also read through the query service, keep the exact numbers of row 1.3 for whole items: they were measured through the API, without a `ProjectionExpression`, and returned the stored number. A `SELECT` of one field (a projection, the shape a `ProjectionExpression` may need) renders a double as plain decimal text where the stored token has an exponent, and turned -0.0 into 0 (3 values): the bits are otherwise the same and the text is not, and serde_json then parses the plain-decimal text and the exponent text of the same double to different values for 52 of 350 doubles. That 52 is about projection output; the 62 of 350 above is a different count, serde_json's own parse of a random double landing one ulp off the correctly rounded value, and has nothing to do with projections. Which N1QL statement shapes the backend generates for each read (a whole document or a projection, for `GetItem`, `Query`, `Scan` and `TransactGetItems`, with and without a `ProjectionExpression`) was not checked: the measured reads are the API calls without a `ProjectionExpression` and the raw whole-document and one-field `SELECT`s above, so a path that reads through a projection is not covered, and a projection result is not assumed to keep the number. In the 140 staged writes, a transaction's own view of its own staged write was plain decimal text that differed from the literal written for 105 and from the token a KV read returned after the commit for 97 (the 97 is the figure that bears on the settle, the 105 compares with the literal); as parsed doubles it was the same in all 140; and a KV read after the commit equalled a transactional read after the commit in 140 of 140. The settle does not read a transaction's own view, but it does read what a second transaction sees of a staged document (below), and that was not measured this way. The normalisation pair 1795661746.1234567 / 1795661746.123457, which a unit test of the repository carried as the reason for a tolerance, was a hand-written literal in the unit tests and was never observed; both tokens were among the measured documents, and both services returned each unchanged. | ||
|
|
||
| *What a real change within 4 ulps does now.* The identical-image rule still takes it as unchanged, so the lease of its item stays `committed` after the commit. The next taker's exact settle then does not pass until the item is unstaged: a bounded wait (`TAKEOVER_SETTLE_MAX`, 2 s), then 503 for a plain write, `TransactionConflict` for a `TransactWriteItems` and a skip for a background rewrite. A document that stays unsettled is the safe side, as said below: given the precondition above, an exact settle can only wait longer, never settle early; the cost of waiting is availability: if the text form that the settle compares differed permanently, the item would be refused (503 for a plain write, `TransactionConflict`, a skip) until it is unstaged. Measured live at `cdf2b37`, with the one-ulp variant of the fourth run ("DynamoDB Streams", "Writes onto the item of a gate trial"): 253 probes met the item's own staged document; 6 were acknowledged, each after the item unstaged, and 247 were refused (196 with 503, 45 `TransactionCanceled` after about 2 s, 6 `TransactionConflict`); no acknowledged write was computed on the pre-commit image. And in the live cycle with 17-digit doubles (seven pairs of doubles that differ by one ulp or by a few digits, the `ADD` results compared exactly), 20 trackers were consistent and no settle refusal came after the unstaging (a timing of the first acknowledgement after the unstaging, 7 to 150 ms with a median of 23 ms, is in the run notes and was not re-derived from the probe files, so it is not given here). Only partly measured: the number form that a second transaction reads from a committed document that is still staged. 146 probes on 6 tracks (3 of the 17-digit cycle, 3 of the numeric probe) in which a transactional read saw the staged value gave a value identical to the final KV value in bits and in the Python repr of the parsed double, 0 different; these are parsed doubles only (the probe files hold `json.loads` values, so "text" is a Python repr and the raw wire text was not recorded); 3 + 3 distinct values; the 453 and 230 probes of those runs on tracks with a later acknowledged write are not covered. A transaction's own view of its own staged write differed in text from the post-commit KV token for 97 of 140 staged writes (above), so the form a second transaction reads is not assumed to be the final one. That residual is smaller, not closed. If it differed from the later KV body, the settle would only wait: a mismatch ends in 503 for a plain write, `TransactionConflict` for a `TransactWriteItems` or a skip, which is the safe side. |
There was a problem hiding this comment.
This says that a staged number in another text form can only make the settle wait. The settle parses both reads with serde_json without float_roundtrip. That parse gives the plain-decimal and exponent texts of one double different values for 52 of 350 doubles (line 1385). So for a one-ulp change, the staged form can parse to the old double, and the settle passes on the pre-commit image. Please parse the settle's two reads with a correctly rounded parser, such as serde_json with float_roundtrip. Or say that this case can settle early, and keep it open under (b) in row 4.4 as well as item 15.
| the default `txtimeout` for a stream-table write, and a following writer waited 10 s and | ||
| answered 503 until it lapsed. Now `take_plain_lease_opts` arms an `AcquireGuard` around | ||
| each lease write (the insert of a new lease, and the CAS that takes a marker over). If the | ||
| request is dropped, or the write fails with an error that may hide a write that landed, |
There was a problem hiding this comment.
The guard's task removes OUR plain lease by its id when a lease write fails with an error that may hide a landed write. The text doesn't say what the acquisition does next. If it writes the lease again under the same id, the task can remove the new lease while the write runs under it. Please say that the request then ends with an error, or that a new attempt takes a new id.
|
|
||
| What C and I show, and what they do not. No read shows the own document of a `ConditionCheck` item or of an identical-`Put` item staged (an xattr read of the staged state shows nothing, even for a document staged in an open transaction, tested with raw N1QL), and the taker acknowledged in about 25 ms (median 22 to 26 ms; the longest 9 to 10 s) while other keys of the transaction were still staged. A `ConditionCheck` stages nothing, and an identical `Put` does not leave the item's own document staged, as far as any read shows: an inference from the latency, not a proof. So these two variants do not exercise Gap A (b), the case in which a taker meets a staged document of its own item. The U variant does: the item's own document is staged (KV `n` 1.5, transactional `n` 1.5000000000000002) under a lease that the old tolerance left `committed` or `committing`. At `aaaac8b`, 142 probes in 76 tracks met such a document (the first probe met it in 10 tracks). 7 were acknowledged (`ADD` 3, `PutItem` 2, `TransactWriteItems` 2), each after 0.67 to 11 s of call time (0.67, 1.05, 3.5, 7.96, 9.67, 10.78 and 11.06 s) and each with the item unstaged after it; none was acknowledged with the item still staged. 135 were refused: 503 for 22 (`ADD` 11, `PutItem` 7, `DeleteItem` 4), `TransactionCanceled` for 103, `TransactionConflict` for 7, and 500 for 3. In the backend log a takeover (`lease takeover op=committed`) came within about 50 ms of the probe, and the taker's own query transaction then ran for 8 to 11 s inside the query service (the write meeting the staged document) before `lease end Release`; the refusals are `the item stayed contended for 10.2 s; nothing was written` followed by `lease end Restore`. So what the log shows is that the taker's own transaction waited inside the query service for its write to meet the staged document and then either wrote or gave up at the 10 s deadline, while the settle passed at once on the image that the tolerance called equal; 0 were lost, and no acknowledged write was computed on the pre-commit image. The 7 acknowledgements were each after the document had unstaged, so, as for the second run, they show the refusal and not the order of a write onto a document that is still staged: this variant does not show the ordering itself. At `cdf2b37` the exact settle waits that case out, which masks it. This is an observation on one cluster, not a test of the ordering. 9 answers of 500 in the run (all `InternalServerError`) each had a backend ERROR line `query-txn POST failed: error sending request` (commit outcome unknown, not retried, for a `TransactWriteItems` and for a stream write) within 0.2 to 9 s, and the kill of another trial's query node at the same moment (9 of 9); none left an inconsistent final value, and no other ERROR line occurred. | ||
|
|
||
| The rerun at `cdf2b37`, the code of revision 10 (exact settle): 25 trials, 16 gate trials, 64 tracks, all 64 final states consistent, with one 500 (`InternalServerError`: C, `PutItem`, trial 5, 23.9 s after the kill; backend log `stream write: commit outcome unknown, not retried: query-txn POST failed`, and the kill of another trial's query node 7.4 s into the probe, attributed by the nearest kill, not proven). In its U variant 253 probes met a staged own document: 6 were acknowledged, each after the item unstaged, and 247 were refused (196 with 503, 45 `TransactionCanceled` after about 2 s, 6 `TransactionConflict`); the exact settle waits that case out, as designed. A live cycle with 17-digit doubles at `cdf2b37` (`fb97722`; seven pairs of doubles that differ by one ulp or by a few digits, the `ADD` results compared exactly): 21 trials, 6 gate trials, 20 trackers, all consistent, and no settle refusal came after the unstaging (the 7 to 150 ms of the run notes is not re-derived from the probe files). The numeric probe (20 trials, 4 gate trials, 11 tracks) and the staged-key probe (20 trials, 4 gate trials, 12 tracks) were repeated at `cdf2b37` as well: all consistent. The one 500 of the rerun is counted with the other 500s of these runs (the nine of the fourth run at `aaaac8b`, each with the same ERROR line and a kill of another trial's query node, and the four unexplained ones of the first run); it left a consistent final state. Limits: the yield of own-staged probes is small (142 of about 2,000 U probes, and 7 acknowledgements among them; `DeleteItem` was never acknowledged with the own document staged at `aaaac8b`); the own document's staged state is observable only for U; the backend log shows takeovers and ends, not KV operations; and the order of the writes was observed on one cluster. |
There was a problem hiding this comment.
At aaaac8b, which still had the 4-ulp settle, the U tracks were all consistent too, and no acknowledged write came from the pre-commit image. So these outcome checks pass on both builds. item_unstaged isn't called in a unit test (line 1397), so no test named here fails if it goes back to images_match. Please say that the refusal path is what shows the change: about 2 s, then 503, against 10.2 s of contention on aaaac8b. Or add a U tracker whose condition names the new n, as the numeric probe has.
| (the full three-node run of the upstream suite was made at `389b8bc` and again at | ||
| `9843eeb`, whose backend code is that of `aaaac8b`; the changes of revision 10 (the | ||
| exact settle and cancel-safe lease acquisition) came after the second run and the | ||
| full suite has not been rerun on them, and the runs that cover that code are listed |
There was a problem hiding this comment.
This says the full suite hasn't been rerun on the revision 10 changes. But "Runs at cdf2b37" reports the run at fb97722, the backend code of cdf2b37, with no differences from the 9843eeb run, and the description and #1183 say the same. Please make this sentence say that. The revision 10 status line (line 17) and the last sentence of the full-suite row (line 2726) should name that run too.
| which reads the lease and, by the decision `acquire_drop_action`, removes OUR plain lease by | ||
| its id with a CAS, puts a carried marker back (`restore_taken_lease`; it never deletes a | ||
| marker), and never touches a `committing` or `committed` lease or another writer's lease. | ||
| The guard is disarmed when the lease is returned to the write (whose own guard then takes |
There was a problem hiding this comment.
Nit: a plain PutItem, DeleteItem or UpdateItem has no guard of its own after the acquisition returns its lease (lines 1553 to 1555). Please add "where it has one" here.
| lapsed marker taken for a plain lease), an expired taker lease over a lapsed marker | ||
| (the lease that carries the marker protects it for the larger of 60 s and its | ||
| lifetime plus 30 s only), and a mixed fleet (an older server clears an expired | ||
| lease that carries a marker and writes by KV). The change closes the other two |
There was a problem hiding this comment.
Nit: "the other two windows" reads as two of the three cases listed before it. Please name them: the two windows of revision 8, a process death between a takeover and the taker's committing mark, and a restore that fails twice.
…ct compare everywhere, plain-lease guard kept armed, runs at 71939c0) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Raju Suravarjjala <raju@couchbase.com>
|
@LeeroyHannigan, thank you for round 9. Revision 11 is pushed to this PR (head What changed in the code,
Runs. The guard gap, found by review of revision 11, fixed in Still open, smaller: whether the query service prints a different double (not another spelling) for a committed, still staged document: 146 probes on 6 tracks, parsed doubles only (from run notes; the probe files are scratch). The settle would only wait (503). Retargeted to Inline comments, in your order
Review body
|
LeeroyHannigan
left a comment
There was a problem hiding this comment.
Thanks for revision 11, and for the answer to each comment. I read it at 10a3f3f against main at 5826e1b.
The round 9 condition is met. Both reads of the settle now go through one serde_json with float_roundtrip, so the two spellings of one double parse to the same double. The public code agrees: the SDK's content_as and reqwest's Response::json both call serde_json::from_slice. Lines 1544, 2176 and 112 and the two Nits are resolved too.
I have one question before I approve, on line 1624. As written, it reads as 444 writes acknowledged on the item's own staged change, which the exact settle should refuse. A reply there is enough if those probes met something else.
The other inline comments are smaller corrections to text that revision 11 added. None of them blocks my approval.
CI hasn't run on this PR yet, because the workflow runs from the fork wait for a maintainer to approve them. I'll approve when CI has run on this head and line 1624 is answered.
The code answers are still in the reference repository, which I can't read yet. So rows 2.4, 3.5, 4.1, 4.3, 5.2 and 6.2 stay open, as the RFC says.
| I reran both harnesses on the image of `8d6d8ac` (not `71939c0`): `gate_num17.py` 40 | ||
| trials, 5 gate trials, 13 trackers, 13 of 13 consistent and unstaged (the longest about 120 s; | ||
| `O` never acknowledged), and `gate_ident.py` variant U 9 trials, 7 gate trials, 28 trackers, 28 of | ||
| 28 consistent and unstaged (the longest about 130 s), with 444 probes acknowledged while the item |
There was a problem hiding this comment.
This says 444 probes were acknowledged while the item was staged. In variant U the item's own document is staged (KV n 1.5, transactional n 1.5000000000000002). The exact settle answers 503 on such a document unless it unstages within about 2 s. Rows 4.4 and 15 also say a write onto a staged own document was seen only in the 6 ADD samples on 119b91f. Please say what was staged for these probes, and whether the kill transaction had committed. If it was the item's own committed change, please say how these writes were acknowledged.
|
|
||
| With the parse now correctly rounded, a different spelling of one double no longer matters; the | ||
| residual is a different double, which is smaller, not closed, and cannot be proved offline. If | ||
| it differed from the later KV body, the settle would only wait: a mismatch ends in 503 for a |
There was a problem hiding this comment.
This says that if the second read gave a different double, the settle would only wait. If that double equals the item's pre-commit value, the two reads agree and the settle passes on the pre-commit image. Line 2229 allows this ("a different double could"). Please say that this case can settle early, here and at lines 1597 and 1729. Row 4.4 and item 15 already keep it open, so only the wording changes.
| *The settle.* `item_unstaged` reads the item by KV (`kv_get`, `conn.rs:2057`) and by a | ||
| transactional read in the query service (`txn_peek`, `engine.rs:11327`) and compares the two with | ||
| `settle_images_agree`, which is `exact_images_match`. Both reads are parsed by one serde_json, | ||
| 1.0.151, which has `float_roundtrip` since `d43712b` (`backend/Cargo.toml:38`; `Cargo.lock` holds |
There was a problem hiding this comment.
Both checks named here, the unit tests and cargo tree -e features -i serde_json, include dev-dependencies. Cargo doesn't turn on a feature that only a dev-dependency asks for in a release build, so both checks would pass with float_roundtrip under [dev-dependencies] alone. Please say that line 38 of backend/Cargo.toml is under [dependencies], and give the tree check without dev edges (cargo tree -e normal,features -i serde_json). Please also say that kv_get (conn.rs:2057) reads through kv_get_cas and content_as (conn.rs:1436, conn.rs:1447).
| them (`FLOAT_CLOSE_ULPS`, `fn floats_close`, `fn ulps_apart`, `fn json_equivalent`); it looks for | ||
| `images_match` only inside the bodies of `item_unstaged` and `settle_images_agree`, so a function of | ||
| that name added elsewhere would pass it. The other uses of the compare (visibility, identical keys, | ||
| the pinned image) are pinned by behaviour tests with a one-ulp and a 450-ulp pair, not by the scan |
There was a problem hiding this comment.
This says the visibility wait, the identical keys and the pinned image are pinned by behaviour tests with a one-ulp and a 450-ulp pair. Of the tests named, only a_change_of_300_ulps_is_not_equivalent reaches commit_body_visible, commit_doc_visible and identical_mutation_keys, and it uses the 450-ulp pair. Line 3211 says the pinned-image path has no test. So a tolerance of a few ulps at one of those call sites would pass every test named. Please say that, or add the one-ulp pair to that test.
| acquisition of a `TransactWriteItems` and of a `TransactGetItems` has no `AcquireGuard`: those | ||
| requests run detached, so a client that gives up does not strand their leases, but an error that | ||
| hides a landed insert leaves that lease until it lapses (`TXN_LEASE_TTL`, 10 s, not renewed). That | ||
| is read from the code, not tested, and the fix of `71939c0` does not touch it. **A known residual, |
There was a problem hiding this comment.
The lease insert of a TransactWriteItems can land with its answer lost. A plain write on that item then answers TransactionConflictException at once for up to 10 s, though no transaction holds the item. Behind a lost read lease of a TransactGetItems, it waits to its 10 s deadline and answers 503. Row 4.1 lists three cases where the lease differs from RFC-0003 4.1, and this is a fourth. Please add it to row 4.1.
| CAS-retry counter is exported today). A 100-action `TransactWriteItems` can | ||
| exceed the 30 s `txtimeout` at WAN latency | ||
| (couchbaselabs/extenddb-couchbase#177 `[ref-repo]`). | ||
| - **Multi-node scaling** (Couchb |
There was a problem hiding this comment.
This list is headed "Not run live". This item names the full upstream suite on the revision-11 code, then reports its run at 71939c0 in the same sentence. The suite did run on that code, on a release image, as "Runs behind revision 11" says. Please move the item out of this list. If it stays, please make it name what wasn't run: a repeat on a memory-healthy cluster and a run on a fault-hooks image.
| predates it: its `fetch_session_data` (`backend/src/catalog.rs` at | ||
| `bf67ee2`) takes `account_id`, `role_name` and `session_name`, the | ||
| signature before #1523, and has to be rewritten to read by access key ID. Three later changes | ||
| on `main` are port items too (eleven commits since `1be10124`, none of which changes a trait signature |
There was a problem hiding this comment.
#1411 (c8e66fb5), one of the eleven commits, changes tests/test_table_operations.py, which row 10.3 cites. It renames test_delete_of_a_deleting_table_returns_its_description to test_delete_of_a_deleting_table_is_refused and adds two tests of a DELETING table's description. The trait half of this sentence holds (crates/storage/src changes by one line, in snapshot.rs), but the test-file half doesn't. Please say that #1411 changes that file, here and in the description.
| the base index, also without. | ||
|
|
||
| **Scan** is a SQL++ scan of the table's partition; a parallel-scan segment is | ||
| selected by hashing the encoded primary key (`SHA-256` of `_xdb.pk` and |
There was a problem hiding this comment.
main moved one commit past b6c85950 after this revision. #1087 (5826e1beac) adds tests/test_scan_segments.py. Its tests check that every item of a partition key comes back from one segment, and that a start key from another segment is refused. The file's docstring gives both as measured on DynamoDB. The rule here hashes _xdb.pk and _xdb.sk together, so one key's items spread over several segments. Please add #1087 to the port items, with the change to hash the partition key alone, and cite the new file in row 7.3.
| CAS-retry counter is exported today). A 100-action `TransactWriteItems` can | ||
| exceed the 30 s `txtimeout` at WAN latency | ||
| (couchbaselabs/extenddb-couchbase#177 `[ref-repo]`). | ||
| - **Multi-node scaling** (Couchb |
There was a problem hiding this comment.
Nit: lines 117, 1281 and 2224 say that only the revision-11 code handles a retry under the same lease id. Line 1954 says the revision-9 code deleted the marker there. Please add the same clause here and in (d) of row 4.4.
…text corrections) Text only; the code is that of revision 11 (private main 5e58bea, same tree as 71939c0). - The 444 "acknowledged while staged" probes are relabelled: staged meant other keys of the kill transaction, not the probed item. The probes did not test writes on the item's own staged change; that stays open under rows 4.4 and 15 (b), with a designed, not yet run, test. - A different double equal to the pre-commit value can let the settle pass early. - float_roundtrip: Cargo.toml line under [dependencies], cargo tree -e normal,features -i serde_json, kv_get read path. - One-ulp test named; lost lease insert added as a fourth difference in row 4.1; full-suite item moved out of "Not run live"; upstream ExtendDB#1411 and ExtendDB#1087 noted (test_table_operations.py, test_scan_segments.py); same-lease-id clause in 4.4 (d). Signed-off-by: Raju Suravarjjala <raju@couchbase.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
@LeeroyHannigan, thank you for round 10. Revision 12 is pushed to this PR (head Line 1624 first (4793245531). The count was mislabelled, and I have corrected it in the RFC (front matter line 50; "What the 444 probes were", line 1664; the table row at line 3306).
Inline comments, in your order.
Where your description differs from the code.
CI. Thank you for the note. The workflow runs from this fork wait for a maintainer to approve them. I can't approve them from the fork; could a maintainer approve the runs on Repository access. The read invitation of 2026-12-01 lapses on 2026-12-08. I will send a new one by 8 December, planned for Monday, 7 December. Rows 2.4, 3.5, 4.1, 4.3, 5.2 and 6.2 stay open until you can read the reference repository. Not done. |
LeeroyHannigan
left a comment
There was a problem hiding this comment.
Thanks for revision 12, and for the answer. I read it at 22bf4bd against main at 5826e1b.
Line 1624 is answered. Every place that reports the variant U rerun now says the 444 writes met an own document that had already unstaged. It also says that none of them carried a condition. The round 9 condition stays met, and the other round 10 comments are resolved. Thanks for the corrections on 1442 and 1901.
The inline comments are small corrections to text that revision 12 added. None of them blocks my approval. If you fix them, one push for all of them is easiest, because the workflow runs of each new head need a maintainer's approval again.
I'll approve once CI has run on the head.
The code answers are still in the reference repository, which I can't read yet. So rows 2.4, 3.5, 4.1, 4.3, 5.2 and 6.2 stay open, as the RFC says.
| migration. Two Couchbase limits are cluster-wide: 1,000 scopes and 1,000 | ||
| collections per cluster ("Scopes and Collections"), and 10,000 indexes per | ||
| cluster (the Operator documentation). In the shared tier every GSI, LSI and | ||
| TTL index of every table is an index on ` |
There was a problem hiding this comment.
This sentence follows the one about the second kill-harness run, so "That run" reads as that run, which had 31 acknowledged writes. The 444 come from the variant U rerun on the image of 8d6d8ac. Please name that run here, at line 2299 and in row 15.
| acknowledged while the item was staged") was wrong. | ||
|
|
||
| The probes that did meet an own document that was still staged (xattr present before the probe) | ||
| were 170 rows: 112 refused with 503, 53 with 400, and 5 acknowledged with 200. The 400s, from the error name and message the harness recorded in each row: 46 `TransactWriteItems` probes cancelled with `TransactionCanceledException` ("Transaction cancelled ... [TransactionConflict, None]"), and 7 plain writes (3 `PutItem`, 3 `DeleteItem`, 1 `UpdateItem`) refused with `TransactionConflictException` ("Transaction is ongoing for the item"); the 503s are "Service is temporarily unavailable". Why these answered 400 and not 503 I have not determined: they are the names row 4.1 gives for contention with a transaction's lease, but I did not trace these rows to the code path. The 5 acknowledged writes had a staged |
There was a problem hiding this comment.
Most of these 400s are what the design gives. A TransactWriteItems never gets a 503 here: line 1615 and row 4.3 give it TransactionConflict, which covers the 46 cancellations. For the 7 plain writes, row 4.1 case 3 gives TransactionConflictException after 10 s behind a client transaction's committing lease, as in the second run. Please say so here and in the description, with the call times of the 7 if the harness recorded them.
| migration. Two Couchbase limits are cluster-wide: 1,000 scopes and 1,000 | ||
| collections per cluster ("Scopes and Collections"), and 10,000 indexes per | ||
| cluster (the Operator documentation). In the shared tier every GSI, LSI and | ||
| TTL index of every table is an index on ` |
There was a problem hiding this comment.
In case (4), an unconditional write answers TransactionConflictException while no transaction holds the item, so a client sees it. The row now records only the first three cases in docs/differences-from-dynamodb.md. Please add the fourth there too, or say why it stays out.
| migration. Two Couchbase limits are cluster-wide: 1,000 scopes and 1,000 | ||
| collections per cluster ("Scopes and Collections"), and 10,000 indexes per | ||
| cluster (the Operator documentation). In the shared tier every GSI, LSI and | ||
| TTL index of every table is an index on ` |
There was a problem hiding this comment.
The port item at line 2888 says a GSI scan needs the index's partition key hashed, and tests/test_scan_segments.py checks gpk on its GSI byGroup. This row says "hash _xdb.pk alone", which covers only the table. Please add the GSI case here.
| 503 for a plain write, `TransactionConflict` for a `TransactWriteItems` or a skip, which is the | ||
| safe side. The exception is not safe: if the second read gave a different double that equals | ||
| the item's pre-commit value, the two reads agree and the settle can pass early, on the | ||
| pre-commit image (the case of "A real change of up to 4 ulps" in Drawbacks; open, and no run |
There was a problem hiding this comment.
Nit: "A real change of up to 4 ulps" is the bullet at line 2300, under Transactions, not in Drawbacks. Please point there.
| migration. Two Couchbase limits are cluster-wide: 1,000 scopes and 1,000 | ||
| collections per cluster ("Scopes and Collections"), and 10,000 indexes per | ||
| cluster (the Operator documentation). In the shared tier every GSI, LSI and | ||
| TTL index of every table is an index on ` |
There was a problem hiding this comment.
Nit: row 4.4 (d) and line 3330 now say that only the revision-11 code handles a retry under the same lease id. Item (ii) here still credits the revision-9 code alone. Please add the same clause here.
navareamol
left a comment
There was a problem hiding this comment.
Main changed after the last read, and one rule is missing from the RFC. #1093 (merged today) makes UpdateTable answer UPDATING. On every backend a change to ProvisionedThroughput, BillingMode, TableClass or StreamSpecification keeps the stored status ACTIVE, writes now plus control_plane_delay_seconds to status_transition_at, and the table reports UPDATING until then. A second capacity change inside the window is refused with ResourceInUseException (docs/design/04-component-storage.md, lines 645 to 647). The commit also adds crates/storage/src/update_window_conformance.rs, which each backend runs against its own database, and tests/python/test_update_table_status.py. The RFC never mentions UPDATING, status_transition_at or control_plane_delay_seconds. The in-crate checks at line 3442 and the port list do not include update_window_conformance, and the row that says the full upstream suite passes was run before this change. Could you add the check to both lists, say where the Couchbase catalog keeps status_transition_at, and say whether the suite still passes with the new test file?
Lines 736 and 2914 state Couchbase limits (a 246 byte key in a named collection, 1,000 scopes and 1,000 collections per cluster). They match the Couchbase documentation as I read it. Please link the pages there, since the 240 byte threshold and the scope design depend on them: https://docs.couchbase.com/php-sdk/current/concept-docs/documents.html and https://docs.couchbase.com/server/current/learn/data/scopes-and-collections.html.
I will approve once the UPDATING window and update_window_conformance are covered, together with the open points Lee has on this head and CI passing on it.
RFC: Couchbase storage backend
Tracking issue: #1183
This RFC proposes Couchbase Server as an ExtendDB storage backend, following RFC-0002 (Backend Plugin Policy) and mapping every criterion of RFC-0003 (Backend Acceptance Criteria) to the mechanism that meets it and the test that proves it.
What it covers
crates/storage-couchbaseworkspace crate installed throughextenddb_storage::Backendbehind acouchbasefeature, with no changes to the engine, server, auth or core crates;[storage.couchbase]settings inmain's convention; one server per catalog; Experimental tier.Storagetrait and DynamoDB's behavioral invariants: KV point reads, tid-scoped SQL++ Query/Scan, derived index keys inside the item document, CAS-guarded conditional writes with a sub-document fast path, in-process query-service transactions, one lease document per item on every table through which plain writes and transactions exclude each other, explicit stream records whose sequence number is taken from a per-shard KV counter before the commit (a reader stops at an unresolved number and resolves it by a transactional read), TTL through the delete path.extenddb_storage::migrationsin the shapecrates/storage-mongodbuses: aMigrationBackendfor the catalog and data scopes, ledgers,m0001_baseline, the shared resource-tag migration, a migration lock, serving registrations, released checksums anddevtools/check-couchbase-*.v0.1.xpin the backend was built against to theStoragecontract onmain: migrations, secret keys and the key ring, stream lineage,SnapshotEngine/BackupCatalog/RestoreEngine, the metrics account dimension.Evidence and its sources. A complete implementation exists at https://github.com/couchbaselabs/extenddb-couchbase (private today; a new read invitation was sent to the first reviewer on 2026-12-01 and it expires after 7 days (pending on 2026-12-03); the repository goes public before FCP). Until a reviewer has read it, every
docs/,scripts/andtests/path, QE id, commit id, pass count and timing that comes from it is a claim only it can show, and the RFC marks each one[ref-repo](front matter). That covers the upstream conformance figures (the suite ate41f370and at the pin7b828b0) and the 343-case QE plan. The multi-node YCSB figures are not from that repository: they come from Couchbase's performance CI (runs of 2026-10-22 to 2026-11-01), which the front matter names as a second source, and each is marked[perf-ci], not[ref-repo]. No reviewer can repeat those runs yet. Upstream test files (upstream/tests/) are not marked; edits to files onmain(the README row,docs/differences-from-dynamodb.md,tests/test_gsi_multi_range_query.py,tests/test_fgac_leading_keys.py) are not marked either.What changed in revision 12 (2026-12-04)
Revision 12 answers the round-10 review. It changes text only: no code changed and no live run was made for it (one unit test was run in a scratch export, with and without a tolerance mutation, and
cargo treewas run offline on an export of5e58bea). The code is that of revision 11 below (tip71939c0of the revision-11 branch; the private main5e58beamerged it as #247 after revision 11 was written, with the same tree:git diff 71939c0 5e58beais empty; #248,ea21e46, was merged after it). The live probes ran on earlier images (8d6d8ac) and the unit tests at71939c0.float_roundtripcheck.backend/Cargo.toml:38is under[dependencies]; the check iscargo tree -e normal,features -i serde_json(no dev-dependency edges), and the RFC says thatkv_getreads throughkv_get_casandcontent_as.image_compare_is_exact_without_a_tolerance) for the visibility wait and the identical-image rule, and says the pinned-image path of a single-item write has no test of its own.TransactionConflictanswers (46TransactWriteItemscancellations and 7 plain writes, from the recorded error names); why a 400 and not a 503 I have not determined. The 6ADDsamples on119b91fremain the only evidence for (b). That stays open under rows 4.4 and 15 (b), with a test (gate_own.py) designed and not yet run; it has no date and may never meet a staged own document, which would leave (b) open.TransactWriteItemsorTransactGetItemsthat landed and whose answer is an error such as a timeout (no guard; an insert that answers "exists" is read and a lease under the caller's own id is adopted). A plain write then answersTransactionConflictExceptionat once while aTransactWriteItemslease is there (up to 10 s); behind aTransactGetItemsread lease it waits up to its own 10 sCAS_DEADLINEand answers 503 only if the lease is still there. That assumes the read lease has the same 10 s TTL as the write lease (it does in the code at5e58bea). Read from the code, not tested; no test shows either outcome.71939c0is out of the "Not run live" list; what was not run is a repeat on a memory-healthy cluster and a run on afault-hooksimage.main5826e1be(2026-12-03). The pin7b828b0is 376 commits behind it; of the twelve commits since1be10124, fix(engine): describe a DELETING table with the members the service keeps #1411 (c8e66fb5) changestests/test_table_operations.py, which row 10.3 cites (the description says "none changes a cited test file" in revision 11, and that was wrong), and fix(storage-sqlite): keep each partition key in one parallel Scan segment #1087 (5826e1be) addstests/test_scan_segments.pyand moves a helper out oftests/test_read_paging.py. fix(storage-sqlite): keep each partition key in one parallel Scan segment #1087 is a port item: hash the partition key alone for a parallel-scan segment (the reference code hashes the partition and sort keys together); row 7.3 cites the new file. Not run against this backend.What changed in revision 11 (2026-12-03)
Revision 11 answers the round-9 review (one required change and five smaller comments). It changes text and code. The revision-11 code is the revision-11 branch of the private repository (pull request #247, tip
71939c0; merged into the private main as5e58beaafter revision 11 was written, with the same tree as71939c0:git diff 71939c0 5e58beais empty; #248,ea21e46, was merged after it), on top of the commits of the round-10 branch (a local branch, not pushed; all its commits are in the revision-11 branch) (its first commit isd43712b), which is on top of the revision-10 branch (tipfb97722, backend code ofcdf2b37). The runs are under "Runs behind revision 11" in the RFC. In short:backend/Cargo.tomlenables serde_json'sfloat_roundtrip(d43712b).Cargo.lockholds one serde_json (1.0.151) andcargo tree -e features -i serde_jsonshows the feature on it, so both reads of the settle use it: the KV read (the SDK'scontent_as,conn.rs:1447, type inferred) and the query-service read (the transaction client'sresp.json(),conn.rs:498). The plain-decimal text and the exponent text of one double now parse to the same double. The counts of revision 10, "62 of 350" random doubles one ulp off and "52 of 350" doubles parsed differently by text form, describe the parser befored43712b; the RFC labels them so. Evidence: two unit tests (5,000 random doubles in both spellings and the next double must parse correctly rounded,json_parse_of_both_spellings_of_a_double_is_correctly_rounded; one double in two spellings must agree in the settle and a one-ulp neighbour must not, in all four pairings,settle_images_agree_is_exact_across_spellings); my run of the first test without the feature failed it; a review probe on a scratch copy (not committed) of 981,660 texts, 0 wrong, against 8% to 23% wrong without the feature. A different spelling of one double therefore cannot change the settle's verdict; a different double could, and no run has shown one (the residual stays open, smaller, not closed: 146 probes on 6 tracks, parsed doubles only, the wire text not recorded; the count is from run notes of the reference repository, the probe files are scratch).FLOAT_CLOSE_ULPS,images_match,json_equivalent,floats_closeandulps_apartare deleted (fcdac00); the settle, the visibility wait, the identical-image rule and the check of a single-item write against its pinned image all useexact_images_match(engine.rs:1656). Its stated reason was the one-ulp parse difference, whichd43712bremoves; a real change of one ulp is now a change in all four places (9007199254740993 against 9007199254740992.0 and 0.0 against 5e-324 are unequal as well). "Exact" means exact on the parsedf64, not on the token: two tokens of one double compare equal, and a document edited from the Couchbase side (XDCR, SQL++, Eventing) can carry such tokens, so the claim holds for the documents this backend writes (native_numberkeeps two native tokens from colliding). A visibility wait that never matches runs to its 15 s bound and leaves the leasecommitted, the safe side; its cost is availability. A consequence offloat_roundtripin storage: some 16- and 17-digit decimals that used to be stored as exact strings now round-trip and are stored native (item.rs:1823); old documents decode as before; performance was not measured.take_plain_lease_optsthe id is drawn once per call (engine.rs:7630), the insert (engine.rs:7659) and the takeover CAS (engine.rs:7764) are followed by?, so an error that may hide a landed write returns at once and the still-armed guard ends the lease; the loop reuses the id afterOk(false)(the write did not apply, or it reported "exists" or a CAS mismatch, which may hide a landed write), and then reads the lease. This is read from the code, not tested beyond the two fault-hook tests that pause after a clean write. A gap found by review of revision 11, fixed in71939c0, partly tested: before it, the guard was disarmed on everyOk(false)before thekv_get_cas ... ?read (engine.rs:7676), the next deadline check and the backoff, so a write that landed and was reported as failed was unguarded if that read failed, the request was dropped or the deadline fired. Now the guard stays armed through the read and is disarmed only when the read shows the lease is not ours (AcquireState::disarm_unless_ours,engine.rs:2361, called atengine.rs:7677); the takeover CAS'sOk(false)no longer disarms (engine.rs:7770). Tested by a unit test of the helper (not of the call-site order; it fails on a mutant of the helper) and by a live fault-hook test (tests/test_fault_hooks.py:1549; a hook turns a landed insert into "not written", the client gives up) that fails on a mutant image (r11g-mut, the old behaviour) and passes on the fixed one (r11g). Not tested: a takeover CAS that landed with its answer lost (no hook), a failing read afterOk(false), the deadline path with the guard armed. A known residual: the acquisition of aTransactWriteItems(acquire_leases_as) and of aTransactGetItems(acquire_read_leases) has no guard, so a landed insert whose answer is lost, or whose following read fails, leaves a lease that lapses afterTXN_LEASE_TTL(10 s); a known residual.item_unstaged).item_unstagedis async over a live connection and is not called in a unit test. It now calls a pure function,settle_images_agree, and the two tests above call it. A third test,item_unstaged_settles_with_the_exact_compare, is a text scan of the source (the settle must reachexact_images_match, no tolerance symbol may exist); it is not behavioural, and the RFC says so. My mutation checks: the tolerance put back failed 3 tests, an integer throughf64failed 4, andsettle_images_agreechanged back to a tolerant function failed the scan (a weak mutation: the reintroduced function was an alias). Live, the U trackers atd43712b(24 of 24) and on the merged image (20 of 20), and the 17-digit cycle (29 of 29, 18 of 18 with exponent-spelled pairs, 16 consistent and 0 inconsistent on the merged image), were consistent, with refusals at a median of about 2.0 s (the settle's bound). Ataaaac8bthe U trackers were consistent too, so these outcome checks do not tell the builds apart, and no live run was made against a build with the tolerance.fb97722, whose backend code is that ofcdf2b37: 1248 passed, 41 failed, 16 skipped, 0 differences in status against the9843eebrun. The full upstream suite at71939c0: 1245 passed, 41 failed, 3 setup errors, 16 skipped, 1 xfailed; 3 differences in status against the run at9843eeb, all intests/test_fgac_leading_keys.py::TestLeadingKeys(CreateTable answered 500 with Couchbase code 2120 while ns_server was killed (exit 137) on the cluster nodes; the three tests passed 9 of 9 on a quiet cluster; the cause is a correlation from the logs, not shown to be the backend and not proven to be the cluster; the suite was not repeated on a memory-healthy cluster; the other 41 failures are the same 41 test ids as in the baseline).PutItem,DeleteItemorUpdateItemhas no guard of its own once the acquisition returns its lease). The two windows of revision 8 are named where they were called "the other two": a server process that dies between a takeover and the taker'scommittingmark, and a restore that fails twice.take_plain_lease_opts(engine.rs:7683) and inacquire_leases_as(engine.rs:8400); before, by reading the code offb97722, the plain path waited on its own lease and answered 503, and theTransactWriteItemspath counted a taker's lease as clean-held and would later have deleted the marker. The helperown_leasehas a unit test; the two call sites have no test. (2) A failed read of the operating system's randomness fails the request when a lease id is drawn (engine.rs:1795), where every request used to get the same lease id; the other users are unchanged (leader::node_idandcatalog_cas_backoffignore a failure,cas_backofffalls back to the clock, two sites panic). (3) The first run of the fault-hook file on the merged image failed one test, a regression offcdac00(the acquisition guard was disarmed before theafter_takeover_casfault point);5aba553restores the order and the second run passed. (4)220301cmergesorigin/mainof the reference repository (feat(sqlite): vector search index #244 and fix(postgres): restore must not report ACTIVE before the data copy co… #246) into the branch;cdea5d0and8d6d8acrestore a field and anESCAPEclause that the conflict resolution dropped. (5)71939c0keeps the acquisition guard armed after a lease write that answered "not written" until the read of the lease shows that the lease is not ours (the gap described under "Acquisition after a lease write fails").ConditionCheckstages no document, which is inferred (from a 25 ms acknowledgement) and not shown; the two windows of revision 8 are "addressed in code", not "closed by design" (SIGKILL at one point is tested; no run fails without the change); the numeric probe that showed the defect on119b91fis one pair (about 450 ulps), shown live for that pair and, by unit test, for the comparison function; the plain-lease guard's decision function acts only on our plain lease, with no live test of leaving another writer's lease alone; "fixed" is not used for anything untested. The DynamoDB behaviours named in the text (the cancellation answer, a read that fails against a plain write,TrimmedDataAccessException) are stated as observations without a cited source. The 4 MB transaction size is not enforced upstream (docs/dynamodb-limits.md:89atb6c85950). The sentence "not re-read here" about the developer-guide quote is gone: the passage is as a review fetched the page on 2026-12-03, not fetched by me. Bounds are stated at the defaulttxtimeout(a stream-table lease livestxtimeout+ 20 s: 21 s at 1 s, 620 s at 600 s). Drawbacks (5) gains the clause that a KV outage that caused the ambiguous error also defeats the cleanup. The upgrade path of legacy access-key secrets is stated as open:migratedoes not yet convert them,servedoes not report them at start, the runbook has no step (none of it built or tested).mainb6c85950(2026-12-03; history: revision 12 refreshes this to5826e1be, says that fix(engine): describe a DELETING table with the members the service keeps #1411 changes a cited test file, and adds fix(storage-sqlite): keep each partition key in one parallel Scan segment #1087). The pin7b828b0is 375 commits behind it (364 at1be10124, 373 atc0576603); the eleven commits since1be10124do not change a trait signature or a cited test file;ac0c581c(fix(query): refuse key condition values over the key size limits #481, key-size validation inQuery),c8e66fb5(fix(engine): describe a DELETING table with the members the service keeps #1411, optionalcreation_date_time) andbcba8118(fix(core): count an index name in characters and report its member path #1137, index names in characters) are added to the port items.cargo test --libat71939c0: 383 passed, 387 withfault-hooks(382 and 386 at8d6d8ac; the difference is the one unit test of the guard fix;scripts/lint-storage-invariants.shpasses at71939c0; counts and lint from the run notes of the commit, not rerun while drafting); the fault-hook file at 30 s on the imager11g: 36 passed, 0 failed, 3 skipped, and the SIGKILL test alone passed. The live probes ran on the image of8d6d8ac, not on71939c0, which differs from it only by the guard fix:gate_num1740 trials, 5 gate trials, 13 trackers, 13 of 13 consistent, all unstaged (the longest about 120 s),Onever acknowledged;gate_identvariant U 9 trials, 7 gate trials, 28 trackers, 28 of 28 consistent, all unstaged (the longest about 130 s), 444 probes acknowledged while other keys of the kill transaction were still staged (the probed item's own document was not staged in any of them, and the probes had no condition, so this run did not test conditional writes on an item's own staged change; 5 more acknowledged writes met a staged own document in the snapshot before them and are unresolved; that stays open under rows 4.4 and 15 (b), with a test designed and not yet run), all consistent. In the earliergate_num17run on the merged image (before5aba553) oneAtracker unstaged only after 731.7 s and oneDtracker never unstaged inside its window; neither reproduced when I reran both harnesses on the image of8d6d8ac(the longest of 41 trackers was 129.8 s), and the probe gaps of the earlier run (about 300 s) match the idle sleep of the Mac that ran the containers, against its power log (an explanation from those gaps; I did not reproduce a host sleep). The spread of about 14 s to about 130 s is Couchbase's own transaction cleanup (a 60 s window and a 15 s attempt expiry), which is the availability cost of the exact settle: the item answers 503 ("committed, not yet visible") until the cleanup unstages it. The full upstream suite at71939c0: 1245 passed, 41 failed, 3 setup errors, 16 skipped, 1 xfailed; 3 differences in status against the run at9843eeb, all intests/test_fgac_leading_keys.py::TestLeadingKeys(CreateTable answered 500 with Couchbase code 2120 while ns_server was killed (exit 137) on the cluster nodes; the three tests passed 9 of 9 on a quiet cluster; the cause is a correlation from the logs, not shown to be the backend and not proven to be the cluster; the suite was not repeated on a memory-healthy cluster; the other 41 failures are the same 41 test ids as in the baseline). The run before it was atfb97722(backend code ofcdf2b37; 1248 passed, 41 failed, 16 skipped, no difference in status from the9843eebrun). Not tested: the two adoption call sites, the pinned-image path of a single-item write, performance, the live probes on71939c0itself, and the three paths of the guard fix named above.What changed in revision 10 (2026-12-03) (history: revision 11 supersedes what this section says about the 4-ulp tolerance that the visibility wait and the identical-image rule kept, about the absence of
float_roundtrip, and about the counts 62 of 350 and 52 of 350; those describe the code befored43712b)Revision 10 answers the round-8 review (10 inline comments and the consistency point in its body). It changes text and code. The revision-10 code is the revision-10 branch of the private repository, on top of the revision-9 branch, tip
fb97722(pushed 2026-12-03); the backend code is that ofcdf2b37, and the runs are under "Runs atcdf2b37" and "Runs at9843eeb" in the RFC. In short:d43712b: revision 11 supersedes the statements about the tolerance, the missingfloat_roundtripand the two counts in this bullet).item_unstagedcompares the KV image with the transactional read exactly (exact_images_match): integers exact, doubles byf64equality (-0 equals 0), an integer equals a double only when the double is integral, below 1.8e19 and exactly that integer, key order ignored. The visibility wait and the identical-image rule keep the 4-ulp tolerance (FLOAT_CLOSE_ULPS), because serde_json withoutfloat_roundtripparses some 17-digit tokens one ulp off (62 of 350 random doubles), and they compare the backend's own document with a KV read. The measurement behind it (Couchbase 8.0.0, committed unstaged documents): 350 raw documents (including 1.0000000000000002, 5e-324, 1.7976931348623157e308, subnormals and odd tokens), 442 documents written through the API and 140 staged writes, read after their commit, showed 0 differences in bits or tokens between a KV read and a whole-document read through the query service (a projection turned -0.0 into 0 for 3 values and prints plain decimal text, and its plain-decimal and exponent texts parse to different serde_json values for 52 of 350 doubles, a different count from the 62 of 350 above); the API read paths agreed where observed:GetItem,Scan,TransactGetItems442 of 442 documents,Query261 (221 of the plain table, 40 of the 221 of the stream table), the read of aConditionCheck120 (60 per table), with noProjectionExpression; which statement shapes the backend generates for each read was not checked. The normalisation pair of the unit tests was a hand-written literal and was never observed. A real change within 4 ulps now keeps the leasecommittedand the next taker's exact settle waits for the unstaging (no new poll after 2 s, then 503,TransactionConflictor a skip): measured live atcdf2b37, 253 probes met a staged own document, 6 were acknowledged after the unstaging, 247 were refused, none computed on the pre-commit image; a live cycle with 17-digit doubles was consistent (20 trackers). Only partly measured: the number form that a second transaction reads from a committed document that is still staged (146 probes on 6 tracks (3 of the 17-digit cycle, 3 of the numeric probe) in which a transactional read saw the staged value gave a value identical to the final KV value in bits and in the Python repr of the parsed double, 0 different; parsed doubles only (the raw wire text was not recorded), 3 + 3 distinct values; a transaction's own view of its own staged write differed in text from the post-commit KV token for 97 of 140 staged writes; the 453 and 230 probes of those runs on tracks with a later acknowledged write are not covered; a smaller residual, not closed); if it differed, the settle would only wait, which is the safe side, and if it differed permanently the item would be refused (503) until it is unstaged (an availability cost). "Exact" means exact on parsedf64: this build has nofloat_roundtrip, and a one-ulp change counts as a change only becausenative_number(item.rs) stores a native number only if serialise, parse and canonicalise reproduce it, which a document edited from the Couchbase side (XDCR, SQL++, Eventing) bypasses; the live proof used 7 hand-picked pairs. The 4-ulp residual of revisions 8 and 9 is gone from the settle; the staged number form stays open as said (smaller, not closed); neither is under Gap A (b) or Gap A (e).ADDsamples on119b91f. In the fourth run (harness37ed569, ataaaac8b: 67 trials, 40 gate trials, 160 tracks, all consistent) no taker met a staged document of aConditionCheckor identical-imagePutitem by that route, as far as any read shows (they stage nothing that any read shows: an inference from a 25 ms acknowledgement, not proof), so they do not exercise (b); a one-ulpPutdoes leave the item's own document staged: 142 probes met it, 7 were acknowledged, each after the document unstaged (0.67 to 11 s; that shows the refusal and not the ordering), 135 were refused, 0 were lost. 9 answers of 500 coincided with the kill of another trial's query node. Atcdf2b37the exact settle may wait that case out, which would mask it (the rerun does not show whether it does). This stays an observation on one cluster, not a test of the ordering, and (b) stays OPEN in part. The wording on the marker'sexpis the takeover rule's: it never moves, and each touch keeps the lapsed marker for another 60 s.TransactWriteItemswhoseCOMMITanswer is lost (comment on line 1119). It has live tests:test_ambiguous_commit_without_a_token_stays_ambiguous_and_is_not_retriedandtest_a_committing_lease_is_refused_before_commit_by_and_taken_after. At the defaulttxtimeoutthe leases staycommittinguntilcommit_by(50 s), a secondTransactWriteItemsis cancelled withTransactionConflict, a plain write is refused withTransactionConflictExceptionafter its 10 s wait (not a 503), both beforecommit_by, and both succeed after it (53 s). At 1 s: 1 failed, 33 passed, 4 skipped; the failure is the knowntest_a_conflicting_transaction_in_the_commit_window_cancels_it_does_not_also_commit(cause not established: the held transaction answersServiceUnavailableafter its release where the test expects ok; a 1 stxtimeoutshorter than the hold is the likeliest reason, not confirmed).TransactWriteItemsand aTransactGetItemshave no guard (found open by the correction comment of 2026-12-03; fixed at93d2a4d). AnAcquireGuardis armed around each lease write; a dropped request or an error that may hide a landed write has OUR plain lease removed by id with a CAS (or a carried marker put back) by a spawned task, which never touches acommittingorcommittedlease or another writer's. A process death in that window leaves the lease until it lapses (up to 50 s for a stream-table lease, 30 s for a plain KV write's) with the marker carried. Residuals: the cleanup tries twice with no backoff and then lets the lease lapse (a KV outage that caused the ambiguous error also defeats it), and it is skipped if no runtime handle is available (shutdown); a drop in the short KV write between a plain lease being returned and its release leaves a 30 s lease; a lease write that lands after the cleanup's single read leaks until itsexp. Two fault-hook tests ran live atcdf2b37; on a build with the guard disabled both fail.txtimeout, 62 s at 1 s) and first checks that the taker's document is still there as a plain lease with the originalmarker: it passed solo at 1 s (67 s) and at 30 s (87 s). It covers a SIGKILL at one point; a panic, a SIGTERM shutdown and a restore that fails twice stay untested.Queryor aScanon aCREATINGindex is not refused (comment on line 777): neither path checks a status (read from the code, not run); both operations go in the row fordocs/differences-from-dynamodb.md; the planned fix returnsmain's "Cannot read from backfilling global secondary index: " wording for both.TransactWriteItemsorTransactGetItemsacquisition has no guard); 19 trials had a staged own document in the second run, and the 17 with aPutItemtrack were unstaged 23.4 to 521.7 s after the kill (the other two, 24 s and 91 s; 22.3 to 522.5 s over all 51 tracks of the 19 trials); the fourth run's documents stayed staged 1.6 to 322 s (40 trials, median about 60 s).9843eeb(backend codeaaaac8b; release build, three nodes): 1248 passed, 41 failed, 16 skipped, 1 xfailed, the 41 being the baseline groups of the389b8bcrun exactly; the same suite atfb97722(backend code identical tocdf2b37:git diff cdf2b37 fb97722 -- backendis empty, onlyscripts/commit-point-gateandtests/test_fault_hooks.pydiffer; release image built fromgit archive fb97722with the default demo Dockerfile, no fault hooks; three nodes,durability = majority,txtimeout30 s, the same five chunks plustest_transact_write_conflict.pyas at9843eeb): 1248 passed, 41 failed, 16 skipped, 1 xfailed, 0 differences in status against the9843eebrun test id by test id (1306 ids), so the two runs match exactly, the 41 being the same baseline groups (4aws:SourceIploopback, 2test_stream_table_reuse.py, 35 version skew); caveats: the demo bucket was deleted and recreated before the run (the earlier probe tables are gone); the in-repo Rust tests were not part of it (the 370 and 374 are a separate run); the run covers what the suite covers, not the kill-harness windows. Atcdf2b37: unit tests 370 passed, 374 withfault-hooks, atfb97722(the backend code ofcdf2b37); the fault-hook file 35 passed, 0 failed, 3 skipped at 30 s; the three 5 s tests passed; regression 29 of 29 on the second run (the first run failed 11 tests during a Couchbase query-service authorization outage, code 2120); probes: identical-image track 64 tracks, all 64 final states consistent, with one 500 (C,PutItem, trial 5, 23.9 s after the kill:commit outcome unknown, not retried: query-txn POST failed, with the kill of another trial's query node 7.4 s into the probe; counted with the other 500s of these runs); 17-digit cycle 20, numeric 11, staged-key 12, all consistent.What changed in revision 9 (2026-12-03)
Revision 9 answers the round-7 review (13 inline comments and the title request). It changes text and code. The revision-9 code is the revision-9 branch of the private repository, on top of the revision-8 branch, tip
9843eeb; the backend code is that ofaaaac8b(ce16a55is a commit on it that changes a test only, and skips two tests at a 1 stxtimeout), and the runs behind it are named per commit under "Tested" below and in the RFC's "Runs at119b91fandacf2bcf", "Runs at1f48ec1" and "Runs ataaaac8b". In short:COMMIT WORKonly a token with the request's fingerprint proves that the commit point passed; an absent token, a token of another fingerprint and a failed token read all keep the leasescommittinguntilcommit_by, because thatCOMMIT WORKmay still pass its commit point. A retry with the sameClientRequestTokenthat outlivestoken_wait(txtimeoutplus 10 s, shorter thancommit_by,txtimeoutplus 20 s) answersTransactionConflictand releases nothing; that is read from the code, with a unit test only.TransactionConflictExceptionis answered only behind acommittinglease whosetxnis true or absent; behind one that no client transaction holds, the wait ends in 503.committedrule) use one comparison,images_match(key order ignored, integers exact, doubles within 4 ulps; the idempotency token by itsfingerprintandaccount_id); the taker's settle used it ataaaac8band has been exact since revision 10. Revisions 8 and 9 took doubles within a relative 1e-12 as equal, a defect in the taker's settle: it passed at once for a pending change such as N "1.5" to N "1.5000000000001", so the taker decided from the pre-commit KV image. It was found by review of the round-7 comment on line 1082 (the request to add that pair to theTransactWriteItemsfault-hook case), and it is fixed ataaaac8b(100eeee): one function,floats_close, within 4 ulps (FLOAT_CLOSE_ULPS, at most about 8.9e-16 relative;ulps_apart), served the settle (item_unstaged; exact since revision 10), and serves the visibility wait (commit_doc_visible) and the identical-image rule. The pair is now an ordinary changed write (the lease is released and the new value is read back), and exactly identical images keepcommitted. The earlier statement that this carried no loss of safety, because every pair the wait calls equal also keeps its leasecommitted, was wrong: that protection hands the next writer acommittedmarker whose item may still be staged, and the settle, with the same tolerance, could not tell; that tolerance left a real change within it (N "1.0000000000000002" to N "1.0000000000000004", one ulp apart, both stored as native numbers) taken as unchanged by the settle, which revision 10 removes by making the settle exact (see above); the change from 1e-12 to 4 ulps closed the defect for every change larger than 4 ulps, shown live (371 and 317 failed conditions on the old build, none on the new). Unit tests: 361 passed, 365 withfault-hooks, at100eeee, and 367 and 371 ataaaac8b. The two keep-committedfault-hook tests were rewritten at1f48ec1and passed at 30 s and 1 s there; the whole file passed at 30 s ataaaac8b(32 passed, 0 failed, 4 skipped); at 1 s it gave 31 passed, 1 failed (the knowntest_a_conflicting_transaction_in_the_commit_window_cancels_it_does_not_also_commit), 4 skipped (298 s, atce16a55). A probe of a taker that meets a staged item whose number changes by the pair (the numeric probe of the commit-point gate harness) shows the defect on the build before the fix (119b91f: 371ConditionalCheckFailedanswers to thePutItemwhose condition names the new value and 317 to theDeleteItem, all decided from the pre-commit image, and wrongALL_OLDanswers; noADDlost, from 6 samples) and not after it (29 of 29 trackers consistent at1f48ec1, 20 of 20 ataaaac8b; the yield is small, 5 to 9 gate trials a run).aaaac8b). The text said that a request dropped by its client puts the marker back; that was true only of an escalated write. A single-item write on a stream-enabled table that holds an ordinary lease had no guard: the code that recorded the outcome and released the lease was in the request, so a client that timed out while the write's transaction ran left the leasecommittinguntilcommit_by(50 s at the defaulttxtimeout) even after a clean commit, and every other writer of the item got 503 (aTransactWriteItemscancelled). Now the detached task that runs the transaction ends the lease for the outcome it knows, whether or not the request is alive: a visible commit releases it, a clean failure releases it or puts a taken-over marker back, a commit not yet visible rewrites itcommitted, and a lostCOMMITanswer keeps itcommittinguntilcommit_by. A request dropped while a transaction is in flight only notes that it is gone; the guard acts only when no transaction is in flight, and, as revision 10 added, its acquisition has a guard of its own (above). A task that dies silently (a panic) after its transaction started leaves the lease as it was, plain untilexp, orcommittingonce the pre-commit hook has marked it (the request's tail ends a lease only when no transaction is in flight:tail_may_end_lease); a panic in the middle ofCOMMITkeeps acommittinglease and is therefore conservative, covered by a unit test of that helper and by reading, with no live panic test. A plain write that is not a stream-table write, dropped in the middle of its one KV write, leaves a plain lease until itsexp; the sweeper, reconciler and backfill's held-KV-replace path is unchanged. Escalated writes andreplace_at_casbackground rewrites now run detached, so a dropped escalated write commits and releases where before the drop cancelled it and restored the marker. Tests: the stream-table client-timeout test (passes at 30 s and 5 s), the dropped-marker test, changed to expect a commit and a release (passes at 30 s and 5 s), and the ambiguous-commit-after-a-drop test (passes at 5 s only; it skips at 30 s and at 1 s because its waits are written for a 5 stxtimeout, and at 1 s the held transaction would expire beforeCOMMIT); unit tests of the outcome table and of the phase rule. Drawbacks gets a fifth item for what remains (a lostCOMMITanswer, a silent task death).txtimeoutplus 15 s counted from the writer timestamp of the row after a gap, which is never earlier than theBEGIN WORKof the transaction that holds the missing number, and adds no margin of its own (commit_byadds 5 s). If A1 fails and a record commits after the reader has probed its number and found nothing, that iterator does not deliver it, while an iterator started later would; the sentence that a late record "is still delivered, exactly once" was unconditional and is now conditional on A1; the writers' clocks must agree with the reader's within what is left of the 15 s. Not tested (engineering item 1); no code adds a margin. A third assumption, A3 (a transaction the query service reports as expired, 17010 with noraise, was rolled back), is stated beside A1 and A2, as the ending paths rest on it.RollingUpdatestarts the new pod first), so "Operational requirements" now says to stop the old server before the new one starts (strategy.type: Recreateor the equivalent) for the guarantee that a taker's lease carries the marker.committedmarker of about 150 bytes builds up per key aConditionChecktouches, the firstPutItemafter a marker is p50 11.0 ms against 4.0 ms, and eachTransactWriteItemsattempt makes one extra KV read per mutation action (up to 100 for 100 actions).transaction_result.unstaging_complete; Couchbase's transactions page is cited for NTP, which it requires of cluster nodes, and the ExtendDB server hosts are named under "Operational requirements" (A2 is about their clock).Queryor aScanon aCREATINGindex is not refused anywhere (neither upstream'sIndexInfonor the backend carries or checks the status; read from the code), so it can miss items; a row for it goes intodocs/differences-from-dynamodb.md. A retry of the index pass rescans the whole table, so a hot item can hold the indexCREATINGindefinitely (from the code, not run), and the create lock of the server is held through anUpdateTable's index build and first backfill. The stream reader pays one transactional read per trimmed number, 64 per call, and only a checkpoint older than the 24 h retention meets a trimmed range. The restore heartbeat starts only after the target'sCreateTablereturns, so a target whose index build took longer than 900 s can be reaped before its first heartbeat.389b8bcrow; row 6.3 says each figure names its suite revision or says that it was not recorded, and the parity row names the pin7b828b0; the clause about a "1 s young-gap rule" is dropped (the reader has no such rule: its grace istxtimeoutplus 15 s);d0dc673is named besideb66f6c7as a rename commit.9843eeb). A lease that has expired and carries amarkerstands for that marker for every writer and reader, so none clears it and then writes by KV; the taker writes its own lease over the marker in the one CAS that takes it over, with its short logicalexpand the original marker verbatim (a chain of takeovers keeps the marker's ownexp); the lease's native expiry is the larger of the marker's remaining life (at least 60 s, at most 24 h) and the lease's lifetime plus 30 s, so a taker over a lapsed marker is protected for the larger of 60 s and its lease's lifetime plus 30 s on its own document; a restore writes the marker back as before, and if both its attempts fail the taker's lease still carries it; the taker's owncommittinglease replaces the document without amarkerfield and is itself the protection from then on, with its own 24 h from the mark; in a mixed fleet a server without the change clears such an expired lease and writes by KV, so the guarantee holds only once every server runs the new code. The process death between a takeover and the taker's own mark, and the restore that fails twice, are closed by it by design (SIGKILL tested); the expiry of a marker (24 h, and after that for as long as a writer touches it at least once every 60 s), the expiry of a taker's lease over a lapsed marker, and a mixed fleet stay open.119b91f: unit tests 359 passed (363 withfault-hooks); five new tests, two of them strengthened at119b91f, live on three nodes (durability = majority): the whole file passed (31 passed, 3 skipped at the defaulttxtimeout; 32 passed, 1 failed, 1 skipped at 1 s, the failure being the known 1 s-only test); one SIGKILL test (809714c) passed at 1 s in two runs and at the defaulttxtimeoutin the whole-file run, and that the next writer did not write by KV is shown by the lease log lines and the final state, not by a KV trace. Addressed in code, SIGKILL tested; not tested: a panic of the detached section, a SIGTERM shutdown during the pause, a restore that fails twice, a chained takeover live; the native expiry of the taker's document and the renewal's copy of the marker are unit-tested only.durability = majority, cleanup on, the backend as of493242d), described once in the RFC under "DynamoDB Streams", "Writes onto the item of a gate trial". The second is the one that tests a write onto a staged item document: the harness follows only trials in which the probed item's own document is staged right after the kill; 40-put transactions on a stream table,txtimeout30 s; in 66 trials 19 had such a document, 51 tracks (17 each ofPutItem,UpdateItemADD,TransactWriteItems), and in 51 of 51 the first probe, 0.05 to 0.08 s after the kill, met the staged own document. The first writes were refused (TransactionConflictExceptionafter 10 s or cancelled after 2 s, then 503 or cancelled) until a takeover of thecommittedmarker acknowledged one: 12, 11 and 8 acknowledged probes; 51 of 51 tracks consistent afterwards, no acknowledged write lost, no value of the transaction overwritten, no 5xx other than 503; the control at389b8bcgave the same (21 tracks, 21 consistent). The kills still land 4 to 46 ms (median 7 ms) after the first visible document, so the yield comes from the transaction size; the absence of an observed KV write is not a proof; the late time bins rest on 3 or 4 trials. The first run (txtimeout1 s, 10-put transactions, kill delay 0 to 3 ms, the kills landing 2.7 to 8.1 ms after the first visible document in its 21 gate trials) stays as a second run with its own setting: 120 trials, 21 gate trials, 4,374 probes, the documents staged for 42 to 928 s (median 222 s); only 1 of the 21 trials had the item's own document staged (trial 17: acknowledged at once, 0.04 s, at 68.2 s; the unstaging seen complete at 70 s); 12 of the 4,374 probes answered 500, 8 within 0.7 s of another trial's SIGKILL and 4 unexplained and not reproduced (the second run had none, at anothertxtimeout); 2 of the 12 were applied and are not counted as acknowledged; in trial 27 the item answered 503 from 58 to 755 s (about 700 s) after such a 500, until the unstaging finished (seen at 760 s; that it was thatADD's own transaction is inferred). Probes in both runs use integer attributes; the number-change defect has its own probe (above). A third run ataaaac8bwith the second run's harness (18 trials, 6 gate trials, 16 trackers, all 16 consistent, no 5xx other than 503) was made for the lease-end change. The statements that no run had produced a stuck unstaging are replaced by this result, and the text that bounds how long a marker can refuse writers gives the measured 1.6 to 928 s beside the design bound (24 h, and after that for as long as a writer touches the marker at least once every 60 s).119b91fon three nodes:test_txn_lease8 of 8,test_gsi_fence1 of 1,test_reindex_reconcile3 of 3,test_transaction_rollback7 of 7,test_stream_trim1 of 1, upstreamtest_put_item_create_race9 of 9; the first run after the backend restart had one failure intest_reindex_reconcile(arequest_plusSQL++ query: "stored document not found"), a rerun of that file alone failed one other test of it once and then passed three times, and a clean full run passed; the cause was not found, and that test goes throughreplace_at_cas, which the lease changes touch; rerun later: 29 of 29 at1f48ec1(one earlier run of the set hit one 30 s client read timeout intest_txn_lease::test_single_item_writes_on_a_stream_table_both_succeed_and_yield_to_transactions, not reproduced in three solo runs and the next full run, cause not found), and ataaaac8b29 of 29 in 4 of 5 runs, with one run at 28 of 29 (the failure wastest_reindex_reconcile::test_conditional_delete_on_phone_edited_itemagain, "stored document not found", cause not found); the stall was not reproduced in 5 solo passes and 4 full runs ataaaac8b. The lease driver (2,000 rounds), the absent-item test andtest_transact_get_snapshotwere last run at389b8bcand not rerun at this tip, and the full upstream suite on three nodes was rerun at9843eeband atfb97722(the backend code ofcdf2b37) in revision 10: the lease code changed after389b8bc(the carried marker, the one clock reading, the comparison, the end of a single-item write's lease inside its transaction task), so those results are not results for the tip; the runs that cover the changed code are the fault-hook file, the regression files, the SIGKILL test (passed at 30 s and 1 s ataaaac8b) and the probes.8ec1983names the lease fate after an ambiguousCOMMIT WORKin a function and pins it with a unit test; the code already behaved as the rule (an absent token, a token of another fingerprint and a failed token read keep the leasescommitting), and the RFC's text at that line had been incomplete.COMMIT WORKpast itscommit_by(A1); the freeze runs' failed gate; the order of a takeover's transaction after a committed one is untested as a property (observed, see revision 10).What changed in revision 8 (2026-12-01)
Revision 8 answers the round-6 review. It corrects statements of fact and describes code: the revision-8 branch of the private repository, on top of
bf67ee2[ref-repo](its backend last changed in389b8bc), pushed to the private repository, which answers the three round-6 comments on the lease rules. The RFC's "Corrections in revision 8" (under "Transactions") lists it. In short:committedlease no longer lapses after 30 s: it expires after 24 h like acommittingone and ends when the next writer's own commit is visible; a marker past itsexpbut still present is taken over like a live one; every writer that takes a marker over (a plain write, a stream-table write, the GSI backfill, the reindex reconciler, aTransactWriteItems) writes through a query transaction, and a taker whose own transaction committed nothing puts the marker back. (B) AConditionCheckitem, and an item whose put, update or delete in aTransactWriteItemsleaves its image unchanged, keeps acommittedlease after a clean commit instead of having it deleted; a single-item write (an escalated plain write, or one on a stream-enabled table) whose staged image equals the pinned image keeps it too (numbers compare by value; within a relative 1e-12 in the revision-8 code, which was a defect, now within 4 ulps for this rule and the visibility wait, see revisions 9 and 10). The single-item rule uses the same comparison as the visibility wait, and is a safety rule that errs toward keeping the marker: N "2.0" over "2" is not such a case (the server normalises it, the write commits nothing and leaves no lease), and no API-reachable pair is known that differs as an item and stores a bit-identical document. (C) The lease records whether a client transaction holds it, so a plain write that waits out 10 s behind thecommittinglease of a stream-table or escalated write answers 503, andTransactionConflictExceptiononly behind a client transaction's.823f7e8(353 withfault-hooks; 341 and 345 before) and 350 ate2fa27f. The fault-hook file on a single node at823f7e8: 24 passed and 3 skipped at the defaulttxtimeout, 25 passed, 1 failed and 1 skipped at a 1 stxtimeout(the failure also occurs onbf67ee2at that setting); at389b8bc, with the new identical-image stream-table test (it passes there and fails at8d941daand823f7e8), 25 passed and 3 skipped, and 26 passed, 1 failed (the same known test) and 1 skipped. On three nodes atdurability = majority: 9 new fault-hook cases passed at823f7e8, before8d941damade the multi-node lease view fail on a query error (rerun at389b8bc: the whole file, not only the nine cases, 25 passed and 3 skipped at the defaulttxtimeout, and 26 passed, 1 failed and 1 skipped at a 1 stxtimeout(the failure is the 1 s-only test that also fails on a single node), with the lease view returning documents, so no test passed on an empty view), and lease drivers of 4,000 rounds at823f7e8(two runs) and, a separate set, 2,000 rounds at389b8bc(one run, plain and stream-enabled tables) lost no write and answered no 503; the second ran on a loaded host with medians 7 to 17% above an earlier run, attributed to host noise and not proven. At389b8bc, on three nodes atdurability = majorityand the default 30 stxtimeout: the full upstream suite (59 files after theCONFORMANCE.mdfilter; tests of7b828b0, plus thetest_transact*files of upstreamd4dd0ba4) passed except 4aws:SourceIploopback tests (the server sees the Docker gateway address, not 127.0.0.1: an artifact of running in a container on macOS, not rerun on the baseline), 2 intest_stream_table_reuse.py(also fail onbf67ee2: the feature is not implemented) and 35 in two files that exist only atd4dd0ba4(identical list of failures onbf67ee2: test-version skew); the images were built with the pinned dependency served from a local clone of the same sha7b828b0(Cargo.lockunchanged);test_txn_lease.py8 of 8,test_gsi_fence.py1 of 1,test_transaction_rollback.py7 of 7,test_stream_trim.py1 of 1; an upgrade frombf67ee2to389b8bcon one cluster (24 of 24 acknowledged items intact, 0 errors; tested on hand-made old-format markers only, sincebf67ee2left none; a legacycommittingmarker withouttxnmakes a plain write wait 10 s and answerTransactionConflictExceptionuntil its derivedcommit_by, about 10 minutes); and a lease build-up (2,000ConditionChecks on 500 keys left 500committedmarkers of about 147 B each, 73.8 KB, 24 h expiry; the first laterPutItemon such a key p50 11.0 ms against 4.0 ms with no marker). What was not run is listed in the RFC's "Runs behind revision 8".ConditionChecktransaction costs about 7 ms more (median 12.2 ms on the quiet run, 11.9 ms in an earlier one, against 5.0 to 5.1 ms); a process death between a takeover and the taker's owncommittingmark, a restore that fails twice, the expiry of a marker (24 h, and after that for as long as a writer touches it at least once every 60 s) and a mixed fleet can still lose a marker (Gap A (d), OPEN); the order of a takeover's transaction after a committed one is untested (Gap A (b)); the residual of a real change of up to 4 ulps in the taker's settle, which revisions 8 and 9 left open, is gone from the settle in revision 10 (exact on parsedf64), with the number form a second transaction reads from a committed-but-staged document only partly measured (smaller, not closed). (As of revision 8; revision 9 closes the first two of the lost-marker windows by design, SIGKILL tested, see above.)txtimeout1 s), and the reader resolved the staged records by a transactional read (101 of the 102stream gaplines in its backend log; the first resolution 16.0 to 16.4 s after the kill). It is one harness on one cluster, coordinator only, and its scripts are in the repository (scripts/commit-point-gate/, added in1c44cc6and renamed ind0dc673andb66f6c7[ref-repo]) only as a copy that was syntax-checked, not rerun, whose README lists manual setup steps; the freeze runs still failed the gate. Row 5.2 stays OPEN.COMMIT WORKanswering only after the unstaging. A2 is stated as the clock of the server that writes and comparescommit_by(the query node timestxtimeouton its own clock), with NTP. Couchbase's transactions page requires NTP across cluster nodes, and the ExtendDB server host is not one, so the RFC cites the page and names those hosts under "Operational requirements" (revision 9).committedlease and acommittinglease after an unknown outcome that the token does not prove committed (no token, an absent token, a token of another fingerprint, or a failed token read) both expire after 24 h (takeover of acommittinglease fromcommit_by), and a stuck unstaging can block every writer of the item for 24 h, and after that for as long as a writer touches the marker at least once every 60 s.ConditionCheckitem's lease deleted with no check after a clean commit, is closed by (B). Item 15 lists it. Row 4.5 stays OPEN in part as before.TransactionConflictExceptionfor up tocommit_byafter a client transaction's unknown commit) and that an escalated plain write holds the lease across a query transaction on any table. In the code behind revision 7 a secondPutItembehind a stream-table or escalated write'scommittinglease answeredTransactionConflictExceptionafter 10 s with no transaction holding the item; in the revision-8 code it answers 503 (C).3988255is not pushed; its backend, tests, demo and scripts are the same asbf67ee2(see the last paragraph).mainthe write-skew test file has 6 tests andtests/test_transact*.pyhas 95 test functions (counted at5489d29acandd4dd0ba4), against 5 and 63 at the pin7b828b0; the tests ofmainhave not been run (a six-test copy of the file from a local clone of upstream passed 6 of 6 in 3 runs on three nodes; its revision was not recorded).CREATING. A trimmed-horizon iterator passes a number still unresolved at 24 h.session_data_conformanceand the newAuthorizationStore::fetch_session_datasignature (fix(auth): read a role session's policy and tags by its access key #1523) are in the port lists.DeleteTableon it answersResourceInUseException) are dropped from the divergence list: on the reviewer's reading of AWS's DeleteTable reference (ResourceInUseExceptionforCREATING,ResourceNotFoundExceptionfor a resource that is notACTIVE; not re-read for this revision) both match the service.COMMIT WORKpast itscommit_by(A1); the freeze runs' failed gate.What changed in revision 7 (2026-11-28)
Revision 7 corrects revisions 5 and 6; the correction comment on this PR lists what was wrong, and the RFC's "Corrections in revision 7" (under "Transactions") states it.
committinglease over by CAS at once. On three nodes atdurability = majoritythat let a secondTransactWriteItemstake over a first whose commit was still in flight, and both committed (write skew in 34 to 40 of 40 rounds of a driver; the upstream absent-item test failed 4 of 5 tests on every run). Now acommittinglease carriescommit_by(the mark plustxtimeoutplus 15 s plus 5 s, 50 s by default); acommittedlease may be taken over at once, acommittingone only at or aftercommit_by, nothing else ever. Every taker (a transaction, a plain write, the GSI backfill, the reindex reconciler) uses that one rule, waits up to 2 s for the item to settle, and gives up if it does not. On three nodes after the change: 0 of 240 rounds on a plain table and 0 of 240 on a stream table with both committed, and the upstream test 10 of 10 runs. The rule rests on two assumptions stated in the RFC (A1, A2) and not checked against Couchbase's documentation, and no run has held aCOMMIT WORKpast itscommit_by.destroy, corrected. It refuses without a catalog and its version document; it drops recorded table collections, the backend's own fixeddatacollections, an account scope whole only if every collection in it is recorded,dataonly when nothing foreign is left in it, and thecatalogscope last and whole.committingbeforeCOMMIT WORKand release it only on a definite "not committed" or a commit a KV read shows; aTransactWriteItemswaits for every staged document. The failure paths stay OPEN: after a post-commit failure (answered at once) or a visibility wait that reached 15 s, a read can see the earlier image; and thecommittedlease left by those paths lapses after 30 s, after which a plain write clears it with no settle and, on a table without a stream, writes by KV, so if unstaging is still pending then (a node failure after the commit point) cleanup can overwrite that acknowledged write. No run had produced that state at revision 7; a three-node probe of it was still to be run.commit_bycommittingitem at once instead of waiting 10 s.tests/test_gsi_fence.pyfailed 3 times in about 83 runs on the fix branch under heavy load; no fence race was observed, and the one failure examined is arequest_plusscan that missed items already carrying the index column. Its cause is OPEN (item 5).CREATINGand handled by table id; the stream reader no longer stalls after more than 64 empty aged numbers (an iterator below the trimmed horizon now moves forward silently, where DynamoDB answersTrimmedDataAccessException); descending twins only for the backend's own indexes.TransactGetItemsrenews its leases during its passes, bounds each pass at 3 s, and checks every lease after the last pass.Status. Revision 12 (2026-12-04; revision 11 was 2026-12-03, revision 10 was 2026-12-03, revision 9 was 2026-12-03, revision 8 2026-12-01 and revision 7 2026-11-28; the lease rules changed in the code between revisions 7 and 8, and between revisions 8 and 9 a taker's lease came to carry the marker it took over and a single-item write's transaction task came to end its own lease). Rows 2.4, 3.5, 4.1, 4.3, 5.2 and 6.2 of the acceptance table stay OPEN until a reviewer has read the reference repository. Open engineering parts:
PutItemafter its lease insert while a transaction commits on the key is not written (revision 10 added a hold after the lease insert for its acquisition tests, with a client that gives up); aCOMMIT WORKheld pastcommit_byis not tested.AT_TIMESTAMP(supported onmainfrom feat(streams): AT_TIMESTAMP shard iterator on all four backends #468, absent at the pin).tests/test_gsi_fence.py; an index that staysCREATINGuntil acommittingorcommittedmarker expires (24 h, and after that for as long as a writer touches the marker at least once every 60 s) if its item never settles (item 15).committingmark and the restore that fails twice are addressed in the revision-9 code, with SIGKILL tested at one point and the same-id retry changed in revision 11, not tested). It leaves rows 4.4 and 4.5 OPEN in part.389b8bc(results under "Tests of that code") and at9843eeb(revision 10 above: 1248 passed, 41 failed, all baseline groups) and atfb97722, the backend code ofcdf2b37(1248 passed, 41 failed, 0 differences in status from the9843eebrun; not the in-repo Rust tests, not the kill-harness windows), and at71939c0, the tip of the revision-11 code: 1245 passed, 41 failed, 3 setup errors, 16 skipped, 1 xfailed; 3 differences in status against the run at9843eeb, all intests/test_fgac_leading_keys.py::TestLeadingKeys(CreateTable answered 500 with Couchbase code 2120 while ns_server was killed (exit 137) on the cluster nodes; the three tests passed 9 of 9 on a quiet cluster; the cause is a correlation from the logs, not shown to be the backend and not proven to be the cluster; the suite was not repeated on a memory-healthy cluster; the other 41 failures are the same 41 test ids as in the baseline); the parity suite and the rest of the older upstream runs were on a single node (durability = none).The unresolved questions at the end of the RFC are the shared-tier bound, Community Edition, and whether the lease on every table is acceptable.
The revision-7 code is the single commit
bf67ee2on the private repository's the round-5 branch, pushed (later squash-merged with the other work of rounds 4 to 7 as9daaef9, #244). The fix-branch commit3988255, on which the unit tests ran (cargo test --lib341 passed, 345 with thefault-hooksfeature[ref-repo]), is not pushed;git diff --stat 3988255 bf67ee2 -- backend tests demo scriptsprints nothing (checked 2026-12-01), so those tests ran on the same backend and tests asbf67ee2. Most live runs behind revision 7 were made one or more commits before that code; the RFC's "Runs behind revision 7" says which.The revision-8 code is the revision-8 branch of the same repository, on top of
bf67ee2[ref-repo](its backend last changed in389b8bc, where the runs were made;d0dc673moved a script directory andb66f6c7renamed the names in it, and nothing else changed after it), pushed to the private repository. The runs listed first were made at823f7e8;8d941dathen changed only tests (the multi-node lease view in the fault-hook tests now fails on a query error);e2fa27fchanged the backend (the identical-image rule for single-item writes),1c44cc6added the commit-point harness,389b8bcchanged one test, andd0dc673andb66f6c7renamed the harness directory and the names in it; the RFC's "Runs behind revision 8" lists them and what was not run.The revision-11 code is the revision-11 branch on top of the commits of the round-10 branch (a local branch, not pushed; all its commits are in the revision-11 branch), tip
71939c0[ref-repo](private pull request #247, merged into the private main as5e58beawith the same tree):d43712b(serde_jsonfloat_roundtripand two unit tests of the parse and of the settle's verdict),ead6698(a comment),fcdac00(exact comparison everywhere, adoption of a lease under the request's own id, entropy failure fails the request),220301c(merge oforigin/mainof the reference repository),cdea5d0(restores a field and a call the merge dropped),5aba553(the acquisition guard stays armed until the escalated guard exists),8d6d8ac(restores anESCAPEclause the merge dropped) and71939c0(keeps the acquisition guard armed after a "not written" lease answer until the read shows the lease is not ours). The backend behaviour changed ind43712b,fcdac00,5aba553and71939c0.The revision-10 code is the revision-10 branch on top of the revision-9 branch, tip
fb97722(backend code ofcdf2b37)[ref-repo](pushed 2026-12-03):df1740b(the taker's settle compares numbers exactly),93d2a4d(a plain lease's acquisition is guarded; aTransactWriteItemsorTransactGetItemsacquisition has no guard),c382c65(its two fault-hook tests),c3035ba(the fault pointafter_lease_casin the fault-hook documentation),37ed569(the kill-harness track for aConditionCheck, an identical-imagePutand a one-ulpPut),9287c1aandf218180(the no-token committing-lease test at any server timeout, and its half-way check),f363f65(the exact-settle unit test),cdf2b37(the SIGKILL test's timing) andfb97722(a live probe of the exact settle with 17-digit doubles). The backend behaviour changed indf1740band93d2a4donly.The revision-9 code is the revision-9 branch, on top of
b66f6c7, tip9843eeb(backend code ofaaaac8b)[ref-repo]:8ec1983(lease fate after an ambiguousCOMMIT WORKnamed and pinned by a unit test; behaviour unchanged),567d922,5c95f94andb36d299(the taker's lease carries the marker; unit tests; a fault point and five fault-hook tests),809714c(SIGKILL test),493242d(a takeover is decided and its marker read at one clock reading),119b91f(two tests strengthened) andacf2bcfande94c95f(the kill-harness probes; the second selects trials with a staged item document),2f9ad42and1f48ec1(the number pair in theTransactWriteItemsfault-hook case, rewritten for the comparison fix) and100eeee(the comparison within 4 ulps),2a363a5(the numeric probe of the commit-point gate harness),d663261and7a8d0af(a single-item write's transaction task ends its own lease; its tests),14f7529(the request's tail leaves a lease alone when that task died),879527eandaaaac8b(two commits outside the transaction code, in the reference repository's CI configuration and credential code, which the in-tree backend does not contain) andce16a55(skips two tests at a 1 stxtimeout). The backend last changed inaaaac8b. The fault-hook runs before the fix were made at119b91f; the first kill-harness run used theacf2bcfharness on the119b91fbuild and the second thee94c95fharness on the backend of493242d; the earlier runs stay at389b8bc; the runs at1f48ec1and ataaaac8bare in the bullets above (the 1 s whole-file run at the tip is 31 passed, 1 failed (the knowntest_a_conflicting_transaction_in_the_commit_window_cancels_it_does_not_also_commit), 4 skipped (298 s, atce16a55)). The RFC's "Runs at119b91fandacf2bcf", "Runs at1f48ec1" and "Runs ataaaac8b" list them and what was not run.🤖 Generated with Claude Code