Skip to content

fix: send LastIncreaseDateTime after an UpdateTable raises throughput - #1207

Open
LeeroyHannigan wants to merge 24 commits into
mainfrom
fix/1035-last-increase-date-time
Open

LeeroyHannigan wants to merge 24 commits into
mainfrom
fix/1035-last-increase-date-time

Conversation

@LeeroyHannigan

@LeeroyHannigan LeeroyHannigan commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Changes since the last review

#1093 merged into main on 4 December 2026 as the squash commit 1e2ebdd833, and this PR now targets main. navareamol's comment of 3 December read fe71db992e and finds the four points of the review of 00a127ca3 resolved or answered. Since fe71db992e:

The commits from 00a127ca3 to fe71db992e:

What

An UpdateTable that raises ReadCapacityUnits or WriteCapacityUnits of a PROVISIONED table now sets ProvisionedThroughput.LastIncreaseDateTime to the instant of the request, in whole milliseconds. The UpdateTable response and every later DescribeTable report it, until a later raise replaces it. After a change that lowers a unit and raises none, the descriptions carry no LastIncreaseDateTime. A change with the table's own units keeps it. After a switch from PAY_PER_REQUEST to PROVISIONED, the description reports the instant only while the table is UPDATING. The description of a DELETING table carries none, in the DeleteTable response and in DescribeTable. Before this change, ExtendDB sent the member in no response on any backend.

This PR builds on #1093, which holds a table UPDATING for control_plane_delay_seconds after an UpdateTable. #1093 merged into main on 4 December 2026, and this PR now targets main.

TableThroughputRecord in crates/storage/src/util/throughput.rs decides the instant. Each backend stores it in the table's provisioned_throughput JSON beside the two units, so the change needs no catalog migration. After a switch, the record also stores the end of the UPDATING window. Each backend computes that end once and writes it to #1093's status_transition_at too. PostgreSQL reads NOW() in its first locked SELECT for this, so both values come from the database clock.

The description compares the stored end with the application clock. On PostgreSQL, the ExtendDB host's clock can differ from the database host's. A switch's instant can then leave the description earlier or later than UPDATING ends, by that difference.

On SQLite and PostgreSQL, an UpdateTable whose stored provisioned_throughput does not parse fails with an internal error before any write, as DescribeTable fails on that row.

Why

DynamoDB's answers, measured in us-east-1 on 14, 16, 19 and 20 November 2026, each sequence twice on new tables keyed on pk (S):

UpdateTable on a PROVISIONED 5/7 table DynamoDB
raise to 9/11: the response, and DescribeTable while UPDATING LastIncreaseDateTime at the request instant, in epoch seconds with 3 decimals
the same table once ACTIVE LastIncreaseDateTime, an instant 0.8 s to 2.8 s later
a second raise a new instant
lower both units to 4/6 no LastIncreaseDateTime
switch from PAY_PER_REQUEST to PROVISIONED 5/7 LastIncreaseDateTime while UPDATING, none once ACTIVE
DeleteTable after a raise no LastIncreaseDateTime

ExtendDB reports the request instant while UPDATING and once ACTIVE (#1206).

No recorded measurement raises a table and then lowers it. #1197 lowers only tables that were never raised, and its 9/6 change raises the read units. #1198 raises a table and then switches it to PAY_PER_REQUEST. The service keeps the instant of the raise, but that request changes the billing mode and leaves the units alone. So after a lowering, ExtendDB sends no member. The service's DescribeTable answer while DELETING is not measured either, so it gets the DeleteTable answer.

Fixes #1035

Not in this PR

Each of these is in an open issue:

No issue tracks these:

  • The answers after a raise and then a lowering, and DescribeTable while DELETING after a raise, are not measured. Measuring them needs a table on the service.
  • On Cassandra and MongoDB, an UpdateTable takes a stored provisioned_throughput that does not parse as no stored record. Cassandra also still reads that value twice.

Other open PRs

Testing done

At db3ec98

  • cargo +1.97.0 fmt --all with --check is clean. The two clippy commands of .github/workflows/clippy.yml, with -D warnings, are clean on the whole workspace.
  • cargo +1.94.0 check --locked --all-targets of core, engine, storage and the four backend crates is clean.
  • cargo +1.97.0 test --locked --lib --no-fail-fast of the seven crates: core passed 1260 with 1 ignored, the engine 986 and storage 299. Cassandra passed 194, MongoDB 197 with 87 ignored, PostgreSQL 94, and SQLite 339 with 1 ignored. The other 2 SQLite tests, backup_catalog::write_lock_tests, fail on every branch on the machine that ran them (storage-sqlite: the two write_lock_tests fail when an ancestor of the Cargo target directory is owned by another user #1414). On that machine uid 65534 owns /local/home.
  • cargo +1.97.0 test --locked -p extenddb-wasm-adapter passed its 3 unit tests and the parity corpus. The clippy step of the WebAssembly workflow is clean. The doc_version_literals test passed.
  • Against PostgreSQL 16 with pgvector, cargo +1.97.0 test --locked --release -p extenddb-storage-postgres --no-fail-fast --test table_snapshot --test update_table_window ran with EXTENDDB_TEST_PG_REQUIRED and EXTENDDB_EXPECT_VECTORS, as CI sets them. table_snapshot passed 94 with 2 ignored, the two race measurements that run by hand. update_table_window passed 1.
  • Against a new Cassandra 4.1 container with PasswordAuthenticator, --test direct_integration with the test-hooks feature, filtered to stream_disable and table_engine, passed 6. overlapping_stream_changes_apply_exactly_one (Flaky on Cassandra: overlapping_stream_changes_apply_exactly_one saw both concurrent stream changes apply #1192) passed in the first run.
  • Against a MongoDB 7 replica set, the ignored lib test data_engine::live_tests::update_window::live_update_table_opens_one_window_for_changes_sent_together passed.
  • The engine test a_raise_stamps_last_increase_date_time_as_measured, the unit test a_lowering_after_a_raise_leaves_the_instant_out and the core test a_deleting_description_omits_the_members_the_service_drops passed in the lib run. fix: answer UPDATING while an UpdateTable change applies #1093's update_window_conformance passed on all four backends: in the SQLite lib run and in the PostgreSQL, Cassandra and MongoDB runs above.
  • test_update_table_status.py, test_stream_disable.py and test_warm_throughput_updates.py of tests/python ran against a SQLite server and a PostgreSQL server of this head. The servers had the settings of devtools/run-tests, and the test processes ran without REQUESTS_CA_BUNDLE and CURL_CA_BUNDLE, as in CI. On each backend the files passed 66 tests, with 4 expected failures: the four closed-shard rows of End GetRecords iterators after closed shard exhaustion #372 in test_stream_disable.py.
  • pytest --collect-only collected 7408 tests in tests/ and 863 in tests/python, with no error.

At 5d2ca5b

At fe71db9

  • cargo +1.97.0 fmt --all with --check is clean. The two clippy commands of .github/workflows/clippy.yml, with -D warnings, are clean on core, engine, storage and the four backend crates.
  • cargo +1.94.0 check --locked --all-targets of the same seven crates is clean.
  • cargo +1.97.0 test --locked --lib --no-fail-fast of the seven crates: core passed 1260 with 1 ignored, the engine 986 and storage 298. Cassandra passed 192, MongoDB 197 with 87 ignored, PostgreSQL 94, and SQLite 338 with 1 ignored. The other 2 SQLite tests, backup_catalog::write_lock_tests, fail on every branch on the machine that ran them (storage-sqlite: the two write_lock_tests fail when an ancestor of the Cargo target directory is owned by another user #1414). On that machine uid 65534 owns /local/home.
  • cargo +1.97.0 test --locked -p extenddb-wasm-adapter passed its 3 unit tests and the parity corpus. The clippy step of the WebAssembly workflow is clean. The doc_version_literals test passed.
  • Against PostgreSQL 16, cargo +1.97.0 test --locked -p extenddb-storage-postgres --tests --no-fail-fast passed 501 with 2 ignored, in a debug build. The other 5 fail at the host check of storage-sqlite: the two write_lock_tests fail when an ancestor of the Cargo target directory is owned by another user #1414: three store_identity tests of tests/backup_restore.rs and two tests of tests/catalog_nul_backup_jobs.rs open a filesystem backup store under /local/home.
  • Against a MongoDB 7 replica set, cargo test -p extenddb-storage-mongodb snapshot_engine passed 12, and the ignored lib tests data_engine::live_tests:: passed 22. The standalone test ran against a standalone mongod.
  • Against Cassandra 4.1, cargo test -p extenddb-storage-cassandra --test direct_integration, filtered to table_engine and stream_disable, passed 6.
  • The engine test a_raise_stamps_last_increase_date_time_as_measured, with its new row, and the unit test a_lowering_after_a_raise_leaves_the_instant_out passed in the lib run. fix: answer UPDATING while an UpdateTable change applies #1093's update_window_conformance passed in the SQLite lib run and in each of the three database runs above.
  • Five files of tests/python ran against a SQLite server and a PostgreSQL server of this head, with the settings of devtools/run-tests. On each backend they passed 101 tests, with 6 expected failures. The files are test_update_table_status.py, test_stream_disable.py, test_stream_disable_fold.py, test_warm_throughput.py and test_warm_throughput_updates.py. The 6 are the four closed-shard rows of End GetRecords iterators after closed shard exhaustion #372 and the two rows of test_stream_disable_fold.py that change an index's throughput.
  • pytest --collect-only collected 7339 tests in tests/ and 855 in tests/python, with no error.

Controls

Each control ran on a clean tree, and git checkout put the files back after it.

  • With the arm (false, _) => (before.last_increase_date_time, before.reported_until) of 00a127ca3 put back in for_update, the unit test a_lowering_after_a_raise_leaves_the_instant_out fails. The new engine row fails too, because the answer after the lowering carries the instant of the raise.
  • Without the new line of prepare_for_response, the core test a_deleting_description_omits_the_members_the_service_drops fails, and the engine test fails at the DeleteTable answer after a raise.

At 00a127c

  • cargo +1.97.0 test --locked --lib of extenddb-engine, extenddb-storage and extenddb-storage-sqlite in one run: the engine passed 894, storage passed 292, and SQLite passed 329 with 1 ignored. The other 2 SQLite tests, backup_catalog::write_lock_tests, fail on every branch on the machine that ran them (storage-sqlite: the two write_lock_tests fail when an ancestor of the Cargo target directory is owned by another user #1414). extenddb-storage-postgres passed 87 lib tests and extenddb-storage-cassandra passed 191, which need no database.
  • With the crates/storage-sqlite/src/update_table.rs of 927ef11, the new test a_provisioned_throughput_that_does_not_parse_refuses_an_update fails, because the UpdateTable succeeds.
  • The single clock read has no test. The two reads it replaces were microseconds apart, and a test cannot place the end of a window between them.

At 2554728

  • tests/python/test_update_table_status.py, tests/python/test_control_plane.py, tests/python/test_tables.py, tests/python/test_stream_disable_fold.py, tests/python/test_warm_throughput.py and tests/python/test_warm_throughput_updates.py passed 109 tests on each of SQLite, PostgreSQL, MongoDB and Cassandra.
  • With a 2 s control_plane_delay_seconds on each backend, the raise and switch sequences above sent LastIncreaseDateTime where DynamoDB sends it, apart from the instant once ACTIVE. Every instant had at most 3 decimals.
  • A SQLite catalog that this change wrote, with the same stored members, served fix: answer UPDATING while an UpdateTable change applies #1093's head with no error. The readers of the stored throughput read the units by name.

Line counts at db3ec98 against main at 1e2ebdd833, with the lines after #[cfg(test)] and the test files counted as tests: production +321 -175, tests +289 -23. The docs add 1 line, the row of 421aa193f3. The production and test counts are the same as at 5d2ca5b against #1093's head b8f73c43c6, and at fe71db9 against c8cd0820ec. The two commits after 00a127ca3 that are not merges, 5f2fdb1 and f0516b8, account for production +16 -10 and tests +37 -17.

Checklist

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

ADR / RFC: n/a

Breaking changes

None. After a raise, the UpdateTable and DescribeTable responses carry ProvisionedThroughput.LastIncreaseDateTime, a member that the earlier release never sent. The stored provisioned_throughput JSON gains two members, and an earlier binary ignores them.


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

Amazon DynamoDB answers TableStatus UPDATING to an UpdateTable that changes
ProvisionedThroughput, BillingMode, TableClass or StreamSpecification. A
DescribeTable sent right after the change reports UPDATING too. The table
reports ACTIVE again once the change applies. The service answers ACTIVE to
a DeletionProtectionEnabled, OnDemandThroughput or WarmThroughput change
alone. While a capacity change applies, it refuses another capacity change
with ResourceInUseException. In that time it serves a
DeletionProtectionEnabled change, PutItem, CreateBackup and
UpdateTimeToLive. The answers were measured in us-east-1 on 13, 14 and 17
Nov 2026. ExtendDB answered ACTIVE to these changes on all four backends.

Each backend keeps the stored status ACTIVE and writes now plus
control_plane_delay_seconds to status_transition_at. DescribeTable reports
UPDATING until that instant passes, as does the response to the change that
set it. UpdateTable refuses a BillingMode or ProvisionedThroughput change
before that instant with the service's ResourceInUseException message.

Fixes #1043.
The snapshot tests stood for a table that is not ACTIVE by writing UPDATING
into the catalog. No backend stores UPDATING now. A MongoDB snapshot reads
the reported status, so an UPDATING row opened as an ACTIVE table does, and
two MongoDB tests failed. The fixtures now write CREATING, which every
backend refuses. The trait doc of open_table_snapshot names UPDATING beside
ACTIVE.
Amazon DynamoDB sets ProvisionedThroughput.LastIncreaseDateTime to the
instant of an UpdateTable that raises either capacity unit of a
PROVISIONED table. The UpdateTable response carries the instant, and so
does every DescribeTable after it. A change that lowers both units leaves
the member as it was. After a switch from PAY_PER_REQUEST to PROVISIONED,
the service sends the member while the table is UPDATING and not once it
is ACTIVE. The DeleteTable response carries none. The answers were
measured in us-east-1 on 14, 16 and 19 Nov 2026. ExtendDB sent the member
in no response on any backend.

UpdateTable now writes the instant of a raise into the table's stored
provisioned_throughput JSON, beside the two capacity members, so no
catalog migration is needed. After a switch it also writes the end of the
UPDATING window, and the description reports the instant until then. The
DeleteTable response drops the member.

Fixes #1035.
In `crates/storage-sqlite/src/update_table.rs` both sides add a block
before the commit of `update_table`: main's refusal of a vector index on
the WebAssembly build (#1009) and this branch's `status_transition_at`
write. The merge keeps both, the refusal first, so a refused request
writes nothing.
On SQLite and Cassandra, a table description read a stored
status_transition_at that it could not parse as no UPDATING window, and
reported the table ACTIVE. It now fails with StorageError::Internal, as it
does for an unknown table_status in the same row.

Every SQLite writer of the column stores RFC 3339 text. The Cassandra
column has the timestamp type, which the driver reads as an i64. So only
a row that another program changed gets the error.
These docs now describe the UPDATING time:

- docs/differences-from-dynamodb.md, the control_plane_delay_seconds row
  of the runtime settings table
- docs/manuals/12-extending-extenddb-storage.md, the table lifecycle
- docs/design/04-component-storage.md, sections 6.1 and 6.1.1

Section 6.1 said that UpdateTable sets table_status to UPDATING
atomically. Now it says that the stored status stays ACTIVE, and that the
description reports UPDATING until the instant in status_transition_at.
It also says that the engine reads the status before the backend writes
the change. Two capacity changes sent at the same moment can then both
apply.
…-time

The base branch now holds origin/main a417b2f and two more commits of
#1093. One hunk of crates/storage-sqlite/src/update_table.rs conflicted,
before the commit of update_table_impl. The base adds main's refusal of a
vector index create on the WebAssembly build, then its own
status_transition_at write under enters_updating. This branch writes
status_transition_at from updating_until, which it computes earlier in the
same transaction. The merge keeps the WebAssembly refusal first and this
branch's write after it, and drops the write of the base. A refused
request then writes nothing.
TableThroughputRecord::for_update keeps the stored LastIncreaseDateTime
when a request lowers both units. No test covered the rule: the tests
that check LastIncreaseDateTime lower the units only of a table that was
never raised. The new unit test lowers a record that holds an instant and
compares the whole record.

No recorded measurement raises a table and then lowers it. The doc
comment of for_update now cites the DynamoDB API reference for the rule.
It defines LastIncreaseDateTime as the date and time of the last
provisioned throughput increase for the table.
The SQLite and PostgreSQL UpdateTable parsed the stored
provisioned_throughput twice. The check of an unchanged throughput read it
as a JSON value, with 0 for a member it could not read. The new record
read it as a TableThroughputRecord, with no stored record when it did not
parse. Both now use the record of one parse.

A value that does not parse now fails the request with
StorageError::Internal before any write, as DescribeTable fails on the
same row. The refusal text of an unchanged throughput is the same.
The SQLite description read the clock once for LastIncreaseDateTime and
again for TableStatus. A description built at the end of an UPDATING
window could then report ACTIVE and still carry the instant of a switch
to PROVISIONED. Both members now use one reading.

@navareamol navareamol left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think this needs a rebase and one measurement before it merges.

  1. The branch does not merge with main. #963 is merged now, and the head conflicts in crates/storage-sqlite/src/update_table.rs and crates/engine/src/update_table.rs. The engine conflict is between your changes_capacity check and main's companion.is_some() and switches_to_on_demand terms. I resolved both by keeping both sides and the PR's own tests pass (the engine status tests, test_update_table_status.py 35 of 35). After the merge, cargo test --lib -p extenddb-storage-sqlite does not compile: crates/storage-sqlite/src/table_helpers.rs:523 calls sqlx::query(&format!(...)) and sqlx 0.9.1 refuses dynamic SQL (E0277). The helper comes from the #1093 branch, and your new SQLite test sits in the same module. Could you merge main once #1093 lands and wrap that SQL in sqlx::AssertSqlSafe(...)? The description's "Other open PRs" list names #963 as open.

  2. The unit test a_lowering_keeps_the_instant_of_the_last_raise checks that a request that lowers both units keeps the old instant. The description says no measurement covers raise then lower, and takes the rule from the API reference wording. Have you measured it on the service? I think it needs raise, wait for ACTIVE, then lower both units, twice, before the test pins it. Also, no integration test lowers a table that was raised earlier. I changed the (false, _) arm of for_update to (None, None): the unit test fails, but the engine tests and every row of test_last_increase_date_time_follows_the_measured_answers still pass. A row with raise followed by a lowering would close that gap.

  3. The checklist ticks cargo test --workspace, while "Testing done" lists --lib runs of three crates and two failing SQLite tests. Which one is right?

  4. Two answers the description lists as unmeasured are visible on a server. DescribeTable in a DELETING window returns the instant (I saw it with a 2 s delay and a DeleteTable after a raise), while the DeleteTable response does not. A table switched to PAY_PER_REQUEST after a raise reports its old units and the instant of the raise. Has the service been asked about either? If not, I think leaving the instant out of both answers is the safer default until it is.

I will approve once the branch merges with main and builds its tests, and the lowering rule is measured or removed.

One hunk of crates/engine/src/update_table.rs conflicted. Main added the
companion.is_some() term of #963 to the condition that reads the table
before the backend call. This branch replaced switches_to_on_demand
with changes_capacity in the same condition. The merge keeps both terms.
changes_capacity includes every switch to PAY_PER_REQUEST.

Main moved to sqlx 0.9.1 in #1166, and sqlx 0.9.1 refuses a query string
that the code builds at run time. The SQLite test helper table_with builds
its UPDATE with format!, so the merge wraps that string in
sqlx::AssertSqlSafe.
… values

The engine read the table status before the backend wrote
status_transition_at, so capacity changes sent at the same moment could
all apply. Each backend now refuses a capacity change inside a window in
the write that would open one. SQLite decides it under its write lock and
PostgreSQL under the FOR UPDATE row lock. On Cassandra the LWT of the
tables row is conditional on the status_transition_at that the request
read. On MongoDB the update filter matches that value. Of such changes
sent together, one applies. The others get ResourceInUseException with
the IOPS text.

A request now opens a window only when a member differs from the stored
value. These requests answer ACTIVE and open no window, as before windows
existed:

- ProvisionedThroughput equal to the stored units
- BillingMode PAY_PER_REQUEST on an on-demand table
- TableClass STANDARD on a STANDARD table

DynamoDB refuses the first of these (#1199). Its answer to the other two
is not measured.

The UpdateTable response reports UPDATING only when the request opened
the window, so the engine no longer sets the status. The engine handler
is main's again, apart from its doc comment.

update_window_conformance sends eight changes at once on each backend
and expects one to apply. The engine test sends eight on SQLite.
The two changes under Breaking changes had no entry under Behavior
Changes by Release. The entry names both. UpdateTable and DescribeTable
answer UPDATING for control_plane_delay_seconds after a
ProvisionedThroughput, BillingMode, TableClass or StreamSpecification
change. A second ProvisionedThroughput or BillingMode change in that
time gets ResourceInUseException. The entry also says what a client must
do, and that a rollback to v1.1.0 reads the same rows as ACTIVE.
The merged branch holds main at c057660 and the #1093 change that
decides the UPDATING window in each backend write. Six files conflicted.

- crates/engine/src/delete_table.rs: main's #1411 builds the answer with
  deleting_description, and this branch clears LastIncreaseDateTime after
  prepare_for_response. The merge clears the member on the description
  that deleting_description returns.
- crates/storage-sqlite/src/table_helpers.rs: the status now goes through
  parse_transition_at of #1093, with the one clock read of this branch.
  Both new tests stay.
- crates/storage-sqlite/src/update_table.rs and
  crates/storage-postgres/src/update_table.rs: the locked SELECT reads the
  columns of both sides. The NoOp check and the stored units of
  StoredCapacity come from the TableThroughputRecord that this branch
  parses. The window refusal comes first, then updating_until, which
  now opens only when enters_updating is true for the stored values. On
  SQLite, main's stream decision of #963 follows them.
- crates/storage-cassandra/src/update_table.rs: the stored billing mode
  has one name, stored_bm, and updating_until follows the same rule.
- crates/storage-mongodb/src/table_engine.rs: the imports of both sides,
  and updating_until follows the same rule.

The engine test that #1093 adds calls provisioned_5, which this branch
renamed. The merge calls provisioned(5, 5).
…aise

No recorded measurement raises a table and then lowers it. The rule that
a lowering keeps the instant of the last raise had no measurement behind
it. for_update now leaves the member out after a request that lowers a
unit and raises none. A request with the stored units keeps the record.
The unit test checks both against a raised record. A new row of the
engine test raises a table and then lowers it.
The DeleteTable answer cleared the member, but DescribeTable of a table
that was still DELETING sent it. DynamoDB sends none in the DeleteTable
answer after a raise (measured 2026-11-19), and its DescribeTable answer
while DELETING is not measured. prepare_for_response now clears the
member for every DELETING description, and the DeleteTable handler is
main's again.
SQLite, Cassandra and MongoDB tested whether the stored end of the
window lies ahead of now through reported_status and a TableStatus
comparison. They now compare the two instants. The in_window helper of
the Cassandra backend goes. The doc comment of
StorageError::IndexesInUse names the IOPS refusal that it now carries.

write_tables_row takes eight arguments since the window condition, so it
carries the too_many_arguments allow of its caller apply_table_update.
The merge takes c8cd082 of #1093, which compares the stored end of
the UPDATING window with the clock directly on SQLite, Cassandra and
MongoDB. The import lists of the SQLite and Cassandra update paths
conflicted. The merge keeps the lists of this branch without
reported_status, which the update paths no longer call.
@LeeroyHannigan

Copy link
Copy Markdown
Collaborator Author

@navareamol

  1. The branch merges fix: answer UPDATING while an UpdateTable change applies #1093's branch, which now merges main at c057660 (371a3ec, and fe71db9 for the last commit of fix: answer UPDATING while an UpdateTable change applies #1093). It is not rebased. The sqlx::query(&format!(...)) in crates/storage-sqlite/src/table_helpers.rs comes from fix: answer UPDATING while an UpdateTable change applies #1093, so fix: answer UPDATING while an UpdateTable change applies #1093's merge of main wraps it in sqlx::AssertSqlSafe (646258a). No other query that the branch builds at run time remains unwrapped. Every test target of core, engine, storage and the four backend crates builds, and cargo test --lib -p extenddb-storage-sqlite runs. The description now lists fix(streams): answer a stream change's companions as the service does #963 as merged and gives the conflicts at this head.

  2. It is not measured, and neither UpdateTable that lowers provisioned throughput, and a restored table, report no LastDecreaseDateTime and keep NumberOfDecreasesToday at 0, where DynamoDB reports both #1197 nor A table switched to PAY_PER_REQUEST reports its old provisioned units on SQLite, PostgreSQL and Cassandra, where DynamoDB reports 0 and 0 #1198 has a row that settles it. UpdateTable that lowers provisioned throughput, and a restored table, report no LastDecreaseDateTime and keep NumberOfDecreasesToday at 0, where DynamoDB reports both #1197 lowers only tables that were never raised (5/7 to 4/6), and its 9/6 change raises the read units. A table switched to PAY_PER_REQUEST reports its old provisioned units on SQLite, PostgreSQL and Cassandra, where DynamoDB reports 0 and 0 #1198 raises a table and then switches it to PAY_PER_REQUEST. The service keeps the instant of the raise, but that request changes the billing mode and leaves the units alone. So 5f2fdb1 removes the rule. After a request that lowers a unit and raises none, ExtendDB now sends no LastIncreaseDateTime. A request with the stored units keeps the record. The unit test is now a_lowering_after_a_raise_leaves_the_instant_out (4/6, 9/6 and 9/11 after a raise to 9/11). a_raise_stamps_last_increase_date_time_as_measured has a new row that raises to 9/11, waits for ACTIVE and lowers to 4/6, through the handler on SQLite. With the old arm put back, the unit test and that row fail. The row is not in the Python file, because that file also runs against the service, and the service's answer is not measured.

  3. Both are right. The tick came from CI on 00a127c, where all 54 check runs passed. These include the two run-tests jobs of the Test workflow, on stable and on 1.91.1. Each job runs cargo test --locked --workspace --exclude extenddb-backup-store and then cargo test --locked -p extenddb-backup-store. Testing done listed only the local runs. The body now leaves "All tests pass" unticked until CI is green at this head. Testing done gives each command that ran locally at this head.

  4. The DescribeTable answer while DELETING is not measured, so f0516b8 takes the default you suggest: prepare_for_response leaves the member out of every DELETING description. DeleteTable and DescribeTable now give the same answer, and the DeleteTable handler is main's again. A table switched to PAY_PER_REQUEST reports its old provisioned units on SQLite, PostgreSQL and Cassandra, where DynamoDB reports 0 and 0 #1198 measured the switch on the service on 20 Nov 2026, twice. After a raise, a switch to PAY_PER_REQUEST answers 0/0 with the instant of the raise. It does so in the response, while UPDATING, once ACTIVE and 3 s later. So the branch reports the instant that the service sends. A table switched to PAY_PER_REQUEST reports its old provisioned units on SQLite, PostgreSQL and Cassandra, where DynamoDB reports 0 and 0 #1198 tracks the old units.

Main is at db8a90d. This branch last had main at c057660. Since
then, #1531 merged into main.

One file conflicted: docs/manuals/07-upgrade-manual.md. #1531 added its
v1.2.0 entry at the top of Behavior Changes by Release, where this
branch has its entry. The merge keeps both entries without change. The
entry of this branch stays first. The entry of #1531 comes next, above
the other v1.2.0 entries of main. The other six files of #1531 are not
files of this branch.
…-time

The merge takes b8f73c4 of #1093, which merges main at db8a90d.
The last merge took c8cd082, with main at c057660. Between the
two, #1531 merged into main. #1531 changed seven files, and the commits
of #1207 change none of them, so git merged without a conflict. In
docs/manuals/07-upgrade-manual.md, the v1.2.0 entry of #1531 now
follows the entry of #1093.
@navareamol

Copy link
Copy Markdown
Collaborator

@LeeroyHannigan all four points are resolved or answered at fe71db9.

  1. The head merges with main (c057660) without a conflict, and the SQLite lib tests build. The sqlx::AssertSqlSafe wrap comes in through fix: answer UPDATING while an UpdateTable change applies #1093's head. cargo check --all-targets is clean for the PostgreSQL, Cassandra and MongoDB crates. Core (1260 passed, 1 ignored) and engine (986 passed) match your numbers. The PR still has fix: answer UPDATING while an UpdateTable change applies #1093's branch as its base, so it waits for fix: answer UPDATING while an UpdateTable change applies #1093.

  2. Removing the keep rule is fine with me. After a raise to 9/11 and a lowering to 4/6, DescribeTable now carries no LastIncreaseDateTime on SQLite and PostgreSQL, and a later write-only raise stamps a new, later instant. 10/3 after the raise stamps too, and the same units without BillingMode keep the record. The unit test a_lowering_after_a_raise_leaves_the_instant_out and the new row of a_raise_stamps_last_increase_date_time_as_measured both fail when I put the old arm back. The answer after a lowering that follows a raise is still not measured on the service, as your description says. It follows the one lowering you did measure. One measurement (raise, wait for ACTIVE, lower both units) would settle it. I do not ask for it here.

  3. The checklist and Testing done now agree with each other, and all 72 checks on the head are green. Two boxes are still open: clippy and documentation. docs/differences-from-dynamodb.md has no row for LastIncreaseDateTime, and the PR changes no file under docs/. Is that intended?

  4. DescribeTable while DELETING now carries no LastIncreaseDateTime, the same as DeleteTable. I checked both on SQLite and PostgreSQL with a 2 s delay after a raise. With the clear taken out, the core test a_deleting_description_omits_the_members_the_service_drops and the engine test both fail. For a table switched to PAY_PER_REQUEST after a raise, you say A table switched to PAY_PER_REQUEST reports its old provisioned units on SQLite, PostgreSQL and Cassandra, where DynamoDB reports 0 and 0 #1198 measured that the service keeps the instant of the raise. That is your measurement and I did not repeat it. If it holds, keeping the instant is right, and I retract my suggestion to leave it out.

One thing from my side: my own concurrency test, which assumed that the winner of 8 concurrent raises always stamps, fails at this head on both backends. A request that lowers relative to what another request stored first now gets no instant, so that is the new rule and not a defect.

On Cassandra and MongoDB, the .ok() on the stored throughput is still there and your description discloses it. I did not run those two backends.

The service statements (the raise table, #1197, #1198) are your measurements. I approve once #1093 has merged and this branch is retargeted.

The Control Plane table of docs/differences-from-dynamodb.md had no row
for ProvisionedThroughput.LastIncreaseDateTime. The new row gives the
answers of the service, measured from 2026-11-14 to 2026-11-20, beside
the answers of ExtendDB.

Two cases differ. ExtendDB keeps the instant of the request once the
table is ACTIVE, where the service reports a later instant (#1206). On
MongoDB a switch to PAY_PER_REQUEST loses the instant of an earlier
raise (#1198).

Two answers of ExtendDB are not measured on the service. One is none
after a change that lowers a unit and raises none. The other is none in
the description of a DELETING table.
@LeeroyHannigan

Copy link
Copy Markdown
Collaborator Author

@navareamol The doc needs a row. Before this PR, ExtendDB sent no LastIncreaseDateTime at all, and docs/differences-from-dynamodb.md did not list that either. With this PR, these are ExtendDB's answers next to the measured ones:

Two of ExtendDB's answers are not measured on the service. One is none after a raise and then a lowering, and the other is none in DescribeTable while DELETING after a raise.

421aa19 adds the row to the Control Plane table of docs/differences-from-dynamodb.md, with the once-ACTIVE instant, the MongoDB case and the two answers that are not measured. The same push merges #1093's new head (b8f73c4) into this branch.

Main fixed the control_plane_delay_seconds default in
docs/differences-from-dynamodb.md to 0.25 (#1443). This branch adds
UPDATING to the same row. The merge keeps the 0.25 default and this
branch's description.
…-time

The merge takes f583547, the last head of #1093 before main merged
it as 1e2ebdd. The last merge took b8f73c4. Since then, #1093
merged main at 1174651, eight PRs past db8a90d: #1466, #1087,
#768, #1296, #1485, #1228, #1325 and #1443. Git merged without a
conflict. Two files of this branch have changes on both sides:

- crates/storage/src/util/mod.rs: #1087 declares and exports
  scan_segment, and this branch declares and exports throughput.
- docs/differences-from-dynamodb.md: #1443 changes the
  control_plane_delay_seconds default to 0.25 in two rows, and this
  branch adds the LastIncreaseDateTime row to the Control Plane table.
Main is at 1e2ebdd, two commits past 1174651: #1269 and the
squash commit of #1093. The merge before this one took f583547, the
last head of #1093, and the squash holds the same lines as that head.

Nine files conflicted, in 37 hunks:

- crates/engine/src/update_table_status_tests.rs has 8.
- tests/python/test_update_table_status.py has 2.
- crates/storage-sqlite/src/table_helpers.rs has 3, and update_table.rs
  has 6.
- crates/storage-postgres/src/table_helpers.rs has 1, and
  update_table.rs has 9.
- crates/storage-cassandra/src/table_helpers.rs has 1, and
  update_table.rs has 5.
- crates/storage-mongodb/src/table_engine.rs has 2.

In each hunk, the side of main holds the lines of #1093 as f583547
has them. The side of this branch holds its change to those lines. The
merge keeps the side of this branch.

Git merged three other files with no conflict:
crates/core/src/types/table.rs, crates/storage/src/util/mod.rs and
docs/differences-from-dynamodb.md. In each, main adds the lines of
#1093, which this branch has, and this branch changes other lines.
#1269 changes crates/storage-cassandra/tests/migrations/lock.rs, which
is not a file of this branch.

The diff of this branch against main has the same changed lines as its
diff against b8f73c4 before the two merges.

@navareamol navareamol left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

#1093 has merged and this branch now merges main (db3ec98). Against main the PR's own diff is the same as at 421aa19, file by file: 14 files, 611 added and 198 removed. All 75 checks pass on db3ec98.

I approve.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UpdateTable that raises provisioned throughput, and DescribeTable after it, send no LastIncreaseDateTime, where DynamoDB sends the instant of the raise

2 participants