Skip to content

fix(metrics): bound latency segment memory by summing into fixed time buckets - #398

Merged
LeeroyHannigan merged 25 commits into
mainfrom
fix/bounded-latency-segments
Nov 25, 2026
Merged

LeeroyHannigan merged 25 commits into
mainfrom
fix/bounded-latency-segments

Conversation

@LeeroyHannigan

@LeeroyHannigan LeeroyHannigan commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Changes since the last review

5532d07 merges main at 1d3be63. The commits after it:

  • 737a515 adds a row to bucket_memory_follows_the_requests_up_to_the_ring_length: six seconds, then one request a ring later. The pair holds 2 buckets in a capacity of 9. With the stale-bucket while loop in Ring::record changed to an if, this row fails with 7 buckets held, and every other metrics test passes.
  • 9c57cba builds a one-request bucket with Bucket::new, so add_bucket holds the only sum over the count and the six segment fields.
  • da45615 deletes the ignored timing test bench_old_push_vs_new_record. Its numbers stay under Result.
  • 17f47a2 folds the test helpers bucket_count and bucket_capacity into SegmentStore::buckets.
  • 2e5a5f6 corrects the comments. An account stays counted for up to about 1,446 minutes, and a ring's allocation does not shrink. The comments no longer name the issue number.
  • 7967ac7 corrects the docs. They give the memory of a pair by account shape and say that the allocation does not shrink. They also correct the counter points of a GetItem and the requests that earlier releases recorded. The commit adds a v1.1.0 entry to the upgrade manual.
  • 5c4f613 clears the two pedantic lints on lines this PR adds.
  • 637cefd corrects two doc sentences after the review of 24 Nov. The throttle bucket follows the first attribute of Key or Item. That is name order, or the request's order on a build with the MongoDB backend, so it can be the sort key. A pair's cost is the measured range under Result.

The body changes too. A pair of an account that sends one operation takes about 810 bytes, and a pair keeps the largest allocation it reached. The bound per account replaces the claim that there was nothing for a setting to protect. The body also corrects what AllTime returned before, names the overlaps with other PRs, and gives the test results at 5c4f613.

What

MetricsCollector kept one SegmentPoint per request that reaches dispatch for 24 hours. Each point was a 136-byte struct plus three heap strings (112 bytes and two strings before 0.1.15). Every request pushed one to a Vec, which only the five-minute prune trimmed. The console's Latency Breakdown and the segments array of /metrics read nothing but a per-operation count and the mean of the six latency segments over a window. The collector now sums the points at record time instead.

  • New crates/core/src/metrics/segments.rs: each account's operation owns two rings of 64-byte buckets, up to 301 one-second buckets serving LastMinute and Last5Minutes and up to 1,441 one-minute buckets serving LastHour, LastDay and AllTime. A bucket holds a count and six sums. Slot k of a ring of width b covers elapsed seconds [k*b, (k+1)*b) since the collector's epoch. A ring holds only the slots that had a request, in slot order. A record first drops the buckets outside the ring, then adds its own. The ring's allocation doubles up to the ring length and stops there. The allocation does not shrink: a pair keeps the largest allocation it reached until a day passes with no request for it.
  • A record is two hash lookups (the account, then the operation) and two bucket updates under the existing write lock. It allocates the keys on the first record of each account's operation, and grows a ring at most eleven times over the pair's life. Both the record path and the query path read the clock under the lock. So a stored record is never ahead of a query that follows it. A test checks that the clock runs under the lock. A query finds the window's first slot with a binary search and reads from there. A filtered query looks the account up.
  • Bucket memory is at most accounts * operations * 111,488 bytes. A pair holds all 1,742 buckets only with a request in every second of the last five minutes and every minute of the last day. A pair with one request a day holds two buckets. With its keys and map entries, that pair takes 286 to 429 bytes when its account sends 3 to 40 operations. It takes 475 bytes with 2 operations and 810 bytes with 1 (the table and the run under Result). The handler rejects any X-Amz-Target outside is_known_operation before it records any metric. So operations is at most the 40 names in the dispatch table (37 plus the three PartiQL operations). Per account, the ceiling is 4,459,520 bytes (4.25 MiB) of buckets. accounts counts the accounts that sent a request in the last day. The handler records a segment only for a request that reaches dispatch, so these are accounts in the catalog.
  • query_segments and the OperationSegments JSON shape do not change. The console needs no change. Per-operation counts are exact. The means are the same sums divided by the same counts as before (for integer microsecond inputs the f64 sums stay exact below 2^53). The result omits operations with no request in the window, as before. query_segments now sorts the results by operation name.
  • A record drops the buckets outside its ring. prune() drops the rings of an account's operation once its newest bucket left the 24-hour ring, one comparison per pair. It drops the account once the account holds no operation. So an account that stopped sending requests, or was deleted, returns its segment buckets to the allocator after a day. The process's resident size can stay at its high-water mark.

What changes for a reader: a window of W seconds returns at least the last W seconds and at most W plus one bucket width. LastMinute and Last5Minutes may therefore include up to 1 s beyond the window, and LastHour and LastDay up to 60 s. AllTime returns the same as LastDay. Before, it returned every point the vector held, 24 hours to 24 hours and 5 minutes of requests. The console refreshes every 10 s on Last5Minutes and shows means and a count, so this is not visible there. The upgrade manual's v1.1.0 entry lists these changes.

record_segments no longer takes the table name. Nothing read it (the field carried a dead_code allow and a TODO). A per-table dimension would multiply the bound by the table count, which clients control. SuccessfulRequestLatency in the persisted counter metrics still carries the table and operation dimensions.

The issue asks for a granularity, retention, sampling or cap setting, an overflow counter, and a switch to turn the collection off. This PR adds none. The bound grows with the number of accounts and operations. The request rate does not change it. At the ceiling it is about 4.46 MB per account. So 1,445 accounts at the ceiling hold more than the reporter's 6 GiB limit (computed: 6 GiB / 4,459,520 bytes = 1,444.6). A cap or a switch would still protect such a deployment. #1405 tracks it. A configuration key routes through the RFC process, and this PR does not wait for it.

Why

Closes #397. On a PostgreSQL deployment of 0.1.12 at 274 requests per second, process memory reached about 4.3 GiB in 24 hours. The container limit was 6 GiB. That is the reporter's measurement, over 23.64 million requests.

The reproduction here ran on the unmodified 0.1.13 release binary. 1.2 million GetItem at 1,968 per second over 10 minutes grew anonymous memory by 193.5 bytes per request (least squares from 180 s, r² 0.998). The same build with record_segments made a no-op was flat at 0.6 bytes per request (r² 0.003). So the segment vector was the only per-request growth. 193.5 bytes times the reporter's 23.64 million requests is 4.26 GiB. PR #386 named the 24-hour segments as separate work.

The vector exists at every release through 1.0.0. Until a deployment upgrades, the deployment guide now gives the growth law and a sizing rule. Through 0.1.14 the growth law is about 190 bytes per request that reaches dispatch over a trailing 24 hours, the reporter's figure. From 0.1.15 on it is about 250 bytes, because each record also stores the account id.

Overlap with other PRs

Testing done

All results are at 5c4f613 unless a line names another commit.

  • crates/core/src/metrics/segments_tests.rs and segments_bound_tests.rs (new):
    • bucket size pinned at 64 bytes
    • boundedness over five million synthetic requests across three accounts, five operations and three simulated days, asserting the buckets held and allocated both equal accounts × operations × 1,742
    • a table of six request schedules asserting the buckets held and allocated per pair. The rows run from 1,000 accounts × 40 operations with one request each to a request every second for two days. One row records six seconds, then one request a ring later.
    • a random workload of 300,000 points over three accounts, compared against a naive per-point reference for count (exact) and means (1e-9 relative). The comparison runs without a filter and with each account's filter, over four windows and four query instants.
    • one request per second for three laps of the coarse ring checked against a closed-form arithmetic series at every ring and window boundary
    • window filters at second and minute boundaries
    • ring wrap and stale-slot exclusion
    • an account idle for a day dropped by the prune while an active account keeps its rings
    • operations sorted and zero-count operations absent
  • collector_tests.rs adapted to the new signature. The prune test ages points through the ring, then runs the collector's prune_at a day later and asserts the store is empty. A new test checks that the record and query paths read the clock while holding the lock.
  • Negative controls, each one production edit with cargo +1.97.0 test -p extenddb-core --lib metrics:: run against it:
    • With the collector's segment prune a no-op, prune_keeps_recent_segments_and_drops_them_a_day_later fails.
    • With the clock read before the lock on the record path, and again on the query path, segment_record_and_query_read_the_clock_under_the_lock fails.
    • With the store's prune a no-op, prune_drops_idle_accounts_and_keeps_active_ones and prune_keeps_recent_segments_and_drops_them_a_day_later fail.
    • With the rings allocated in full up front, bucket_memory_follows_the_requests_up_to_the_ring_length fails.
    • With the stale buckets kept, five tests fail, bucket_memory_follows_the_requests_up_to_the_ring_length and boundedness_five_million_records among them. With the capacity cap gone, those two fail.
    • With the stale-bucket while changed to an if, the new row of bucket_memory_follows_the_requests_up_to_the_ring_length fails with 7 buckets held against 2, and the other 33 metrics tests pass.
  • tests/test_metrics.py, tests/test_console_integration.py, tests/test_console_cache_coherence.py against a SQLite release build of 5c4f613, with the runtime settings of devtools/run-tests: 54 passed.
  • Live run, described under Result: 20 minutes at 1,984 GetItem per second, /metrics counts for LastDay, Last5Minutes and LastMinute consistent with the driver count and the rate. It ran on the per-operation store, before the merge with main keyed the store by account.
cargo +1.97.0 fmt --all -- --check                                                      # clean
cargo +1.97.0 clippy -p extenddb-core -p extenddb-server --all-targets -- -D warnings   # clean
cargo +1.97.0 clippy -p extenddb-core -p extenddb-server --all-targets --features extenddb-engine/backup-test-hooks -- -D warnings   # clean
cargo +1.97.0 clippy -p extenddb-core -p extenddb-server --all-targets -- -W clippy::pedantic   # no warning on a line this PR adds
cargo +1.91.1 check -p extenddb-core -p extenddb-server --all-targets                   # clean
cargo +1.97.0 test -p extenddb-core --lib metrics::                                     # 34 passed, 0 failed
cargo +1.97.0 test -p extenddb-server --lib metrics                                     # 9 passed, 0 failed

Docs:

  • docs/design/06-component-server.md section 7.2 states the bucket widths, what each window returns, the bound per account and the memory of a pair by account shape.
  • docs/manuals/11-deployment-guide.md gains a Process Memory subsection for operators on releases through 1.0.0.
  • docs/manuals/07-upgrade-manual.md gains a v1.1.0 entry under Behavior Changes by Release, which the Process Memory subsection links to.
  • docs/todo-index.md drops the TODO entry for the table name field that nothing read.
  • The metrics module doc says that the prune task drops the buckets of an account that sent no request in the last day.

Result

The memory of a pair by account shape, measured at 5c4f613 on 23 Nov 2026. The harness is a release build with a counting allocator and calls the public MetricsCollector API:

store, one request per pair live bytes per pair
1,000 accounts × 40 operations 13,605,520 340
1,000 accounts × 3 operations 1,092,520 364
1,000 accounts × 1 operation 810,520 810

The same harness ran again on 24 Nov 2026, from 05:07 to 05:09 UTC, on the code of 5c4f613. It measured every count from 1 to 40 operations with 1,000 accounts. A pair cost 286 to 429 bytes with 3 to 40 operations, 475 bytes with 2 and 810 bytes with 1. The cost steps up at 4, 8, 15 and 29 operations, where the account's map of operations grows.

A temporary test at 5c4f613 recorded one request a second into one pair for 1,441 minutes: the pair held and allocated 1,742 buckets. One request a ring later left 2 buckets held and 1,742 allocated. One more request a ring after that, followed by a prune, left the same. A prune a ring and ten minutes after the last request dropped the pair.

The results below come from the per-operation store, before the merge with main keyed the store by account. The measurements ran on this host (16 cores, PostgreSQL 15 in a container, release build). The load was GetItem on an 8-item table at 1,984 per second for 20 minutes, 2.4 million requests, 0 errors:

0.1.13 this PR
Anonymous memory growth, least squares from 180 s 193.5 B/request, r² 0.998 5.8 B/request, r² 0.48
Same, from 600 s not measured (10-minute run) 1.7 B/request, r² 0.04
Anonymous memory at 10 min / 20 min 312 MB at 10 min 92.6 MB / 93.1 MB
Segment store after the run 1.2 million points at 176 bytes each (modelled), about 211 MB at most 5 operations × 111,488 bytes, 557 KB

The remaining movement is the one-minute counter flush. From 300 s on, anonymous memory oscillated between 88 and 103 MB with per-minute deltas alternating in sign. The /metrics segments count for GetItem over LastDay was 2,400,033 against 2,400,032 driver requests plus the one GetItem the table setup issues.

The microbenchmarks also ran on the per-operation store, in the release profile, on a single thread, with 1 million calls and three runs each. They used the timing test that da45615 deletes. A record took 73 ns per call against 176 ns for the old push, which allocated two strings per request. query_segments(LastDay) with 37 operations held the read lock for 39 µs (p50, 5,000 samples). The old full scan over 1 million points held the read lock for 39.3 to 39.5 ms. Every request's record waited during the scan.

A record now does two hash lookups, the account and then the operation. An unfiltered query sums every account's rings, so its lock hold grows with the number of (account, operation) pairs that hold data. Measured on a release build with a counting allocator, 1,000 accounts × 40 operations with one request each. The store holds 13,605,520 bytes, 340 per pair. The same points cost 9,922,080 bytes on main, and 4,464,933,520 bytes when every pair allocated its rings in full. On that store the unfiltered Last5Minutes query held the read lock for 5.2 to 12.2 milliseconds. With full rings it held 76.7 to 80.5 milliseconds, and on main 1.7 to 2.2 milliseconds. LastDay held it 3.7 to 5.4 milliseconds (183.8 to 210.5 with full rings, 1.7 to 4.9 on main). The prune held the write lock 0.27 to 1.19 milliseconds (187.9 to 201.3 with full rings, 0.05 on main). The host ran at a load average of 28 to 63 on 16 cores during these runs.

On the per-operation store, under lock saturation the lock limited both shapes more than the work did. At 8 writer threads the old push ran 2.3 to 4.5 million records per second. The new record ran 2.0 to 3.1 million. The new record hashes the operation name under the lock, where the old path pushed a prebuilt point. At 16 threads both ran about 2 million. The live run above recorded 1,984 per second, three orders of magnitude below that.

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. Internal to the in-memory metrics collector. No wire, trait, auth, on-disk, config or CLI change.

Breaking changes

extenddb_core::metrics::MetricsCollector::record_segments changed from (&self, account_id: &str, operation: &str, table_name: Option<&str>, segments: LatencySegments) to (&self, account_id: &str, operation: &str, segments: &LatencySegments). query_segments(window, account_id) keeps its signature: with an account it reads that account's buckets, and without one it sums every account's. This PR updates both callers in the workspace, crates/server/src/handler.rs and the console metrics page test. crates.io lists extenddb-core 1.0.0, published on 2026-11-17. Its description says the crate is internal to the extenddb binary with no API stability promise (docs/adr/0029-crates-io-packaging.md). A reader of the segments that /metrics and /console/metrics-data return sees the changes that the upgrade manual's v1.1.0 entry lists. The windows are wider by up to one bucket, and AllTime equals LastDay. The collector sorts the operations by name and bounds the segment memory. No wire, CLI, configuration or on-disk surface changed.


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.

… keeping one point per request

MetricsCollector kept a SegmentPoint (112 bytes plus two heap strings) for
every data-plane request for 24 hours. At 274 requests per second that is
23.7 million points a day and about 4.3 GiB of anonymous memory (issue
#397); measured here, the 0.1.13 binary grows by 193.5 bytes per GetItem.
The console only reads per-operation counts and mean segments over a
window, so the points are summed at record time instead.

Each operation now owns two fixed rings of 64-byte buckets: 301 one-second
buckets serving LastMinute and Last5Minutes, and 1441 one-minute buckets
serving LastHour, LastDay and AllTime. A record is one hash lookup and two
bucket updates under the write lock; the rings are allocated once per
operation. Memory is at most operations * 111,488 bytes, and the server
only records the 37 operations in the dispatch table, so under 4 MiB per
process. A window of W seconds covers at least the last W seconds and at
most W plus one bucket width. The clock is read under the lock on both the
record and the query path, so a stored record is never ahead of a query
that follows it. prune() no longer touches segments.

record_segments(operation, &LatencySegments) no longer takes the table
name: a per-table dimension would multiply the bound by the table count,
which clients control, and nothing read it. The one caller is updated.

Docs: the design doc states the bucket widths and what each window returns;
the deployment guide gains a Process Memory subsection with the growth law
for releases through 0.1.13; the todo-index entry for the table field is
removed.

Tests: boundedness over five million synthetic requests, a naive-reference
comparison on a random workload, continuous load across three laps of the
coarse ring against a closed-form reference, window filters at second and
minute boundaries, ring wrap and stale-slot exclusion, and an ignored
timing comparison of the old push against the new record.
@navareamol navareamol added the v1 Needed for the 1.0 release label Nov 3, 2026
@navareamol navareamol added this to the 1.0 milestone Nov 3, 2026
Main gave the latency segments an account dimension. record_segments takes the account of the request, and query_segments takes an account filter that /metrics and the console pass. This branch replaced the one-point-per-request vector with fixed time buckets per operation. After the merge the bucket store has two keys: the account, then the operation. A query with an account reads that account's buckets. A query without one sums every account's buckets per operation. It answers what main answered over every account's points, bucketed as this branch buckets them.

crates/core/src/metrics/collector.rs keeps the bucket store from this branch and the account argument of record_segments from main. The SegmentPoint struct goes. The account lives in the store's key.

crates/core/src/metrics/collector_query.rs keeps the bucket query from this branch and the account filter argument of query_segments from main. Main's rule that an empty account is no filter stays.

crates/core/src/metrics/mod.rs keeps the collector_record module from main and the segments module from this branch.

crates/server/src/handler.rs keeps the account argument from main and the borrowed segments from this branch. The table name is not passed, as on this branch.

crates/core/src/metrics/segments.rs did not conflict and gains the account key. Its tests, main's account filter test in collector_tests.rs and main's console metrics page test in crates/server/src/console/pages/metrics_pages_tests.rs call the new signatures.
Main filters the latency segments by account, so the bucket store has two keys: the account, then the operation. The bound test records under three accounts and expects accounts x operations x 1,742 buckets. The random workload test gives each point an account. It checks the answer without a filter against every account's points, and the answer with each account's filter against that account's points. The sort test checks that an account that sent nothing reads empty.
Main filters the latency segments by account, so the bucket store has two keys, the account and the operation, and its bound is per account. The metrics section of the server design doc and the process memory section of the deployment guide now give the bound. It is accounts x operations x 111,488 bytes. With the 40 operations the server dispatches that is 4,459,520 bytes (4.25 MiB) for each account that sends a request. The bound grows with the accounts that send requests and not with the request rate, the table count or uptime. The metrics module doc names the account key.
The segment store allocated the rings of an account's operation on its first request and kept them until restart. An account that stopped sending requests, or that an operator deleted, held 111,488 bytes per operation for the life of the process. Main's prune dropped such an account's segment points after a day.

The metrics prune runs every five minutes. It now drops the rings of an account's operation once the coarse ring's whole-ring window holds no bucket of theirs. It drops the account once it holds no operation. The check reuses the ring's first slot and bucket sum. The fine ring's windows lie inside the coarse ring's, so no query answer changes. The bound in the module doc, the server design doc and the deployment guide counts the accounts that sent a request in the last day. A new store test records under two accounts and prunes at 1440 and 1441 minutes. The idle account goes at 1441 minutes with its two operations. The active account keeps its ring and its data. The idle account's next request allocates its rings again.
query_segments turned an empty account filter into no filter before it read the store, and its test twin query_segments_at did not. The rule now lives in SegmentStore::query, so both readers share one copy and answer alike.
The bound test records under three accounts and five operations and asserts the bucket count of every pair. Its comment named the operations only.
The bound test asserted the number of ring pairs through a test-only accessor and then asserted the exact bucket count. Each pair holds exactly 1,742 buckets, so the bucket count fixes the pair count. The accessor and its assertion go. The random workload test described a point with a four-field struct. It is a four-tuple again, destructured as the three-tuple was before the account joined it. The single-account constant equalled the first entry of the account list and goes. Every assertion keeps its meaning.
The reference check in segments_tests.rs put the account id of its filter into the label of every assertion message. Code scanning reads an account id written to a message as cleartext logging of sensitive data, and reported two alerts on the check. The ids are test constants. The label now names the filter's index in ACCOUNTS instead, and the parameter's name is filter. No assertion changes.

@demohan demohan 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.

The bucket arithmetic, the window edges and the counts hold on SQLite and PostgreSQL, and responses are unchanged against the merge-base. Four items need changes before this merges. The first blocks it: a server with many accounts and little traffic per account now holds a fixed 111,488 bytes per (account, operation) pair, and at 40 operations about 1,445 such accounts fill 6 GiB. The other three are the lock hold of the full-ring scans, the release range in the deployment guide, and a test for the collector prune. The doc items below go in the same pass. The inline comments carry the measurements.

.entry(account_id.to_owned())
.or_default()
.entry(operation.to_owned())
.or_insert_with(OperationRings::new)

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.

The first request of a pair allocates both rings, 111,488 bytes, and holds them for a day. Main holds about 204 bytes per request, so this uses more memory for any pair under about 546 requests a day. Release build, counting allocator, two runs: 1,000 accounts x 40 operations with one request each hold 4,464,933,520 bytes here and 10,076,896 bytes on the merge-base. On a SQLite server, 500 accounts x 17 operations with one request each grew RSS by 215 MB here and 31 MB on the merge-base. At 40 operations about 1,445 active accounts fill 6 GiB. Storing only the buckets that hold requests, ordered by slot and capped at the ring length, keeps today's ceiling and drops below main for sparse pairs. A test with many accounts and one request each would pin it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reproduced on a release build with a counting allocator. 1,000 accounts x 40 operations with one request each held 4,464,933,520 bytes here, and 9,922,080 on the merge-base. 2e5e047 stores only the buckets with a request, in slot order, and caps each deque at the ring length. The same store now holds 13,605,520 bytes, 340 per pair. A pair that sends every second still tops out at 1,742 buckets. One request a day costs 340 bytes against about 248 on the merge-base, and from two requests a day on it costs less. bucket_memory_follows_the_requests_up_to_the_ring_length pins both ends, with the 1,000 x 40 row among its cases.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Correction to my reply above. The 340 bytes per pair hold when the account sends many operations. The same harness at 5c4f613 (release build, counting allocator, 23 Nov), one request per pair:

  • 1,000 accounts x 40 operations: 13,605,520 bytes, 340 per pair
  • 1,000 accounts x 3 operations: 1,092,520 bytes, 364 per pair
  • 1,000 accounts x 1 operation: 810,520 bytes, 810 per pair

So an account that sends one operation once a day costs about 810 bytes, against about 248 on the merge-base. A second request that day adds at most two 64-byte buckets. "From two requests a day on it costs less" was wrong for that account.

A ring's allocation also doesn't shrink. A pair that sent a request every second for 1,441 minutes, then one more a ring later, holds 2 buckets and keeps 1,742 allocated. The prune drops the pair a day after its last request. 7967ac7 puts both in the deployment guide and the design doc. 737a515 adds a row that pins the stale-bucket drop with the allocation kept: 2 buckets held in a capacity of 9.

/// Sums every bucket whose slot is at or after `first_slot` into `acc`.
/// Slots left over from an earlier lap are older than `first_slot` for
/// every window this ring serves, so no separate staleness check is needed.
fn sum_from(&self, first_slot: u64, acc: &mut Bucket) {

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.

sum_from reads the whole ring for every window, and the unfiltered query at line 254 does that for every pair under the read lock. With 1,000 accounts x 40 operations, one request each, two runs: unfiltered Last5Minutes holds the lock 67.9 to 70.6 ms (merge-base 1.95 to 2.01 ms), LastDay 297.7 to 301.0 ms (1.95 to 1.98 ms). A record waiting behind a Last5Minutes query every 50 ms waited up to 73.1 to 80.9 ms (2.5 to 4.4 ms). The console runs that query every 10 s. Reading only the window's slots, and using by_account.get when filtered, bounds it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reproduced on that store. Unfiltered Last5Minutes held the read lock 76.7 to 80.5 milliseconds and LastDay 183.8 to 210.5 (merge-base 1.7 to 2.2 and 1.7 to 4.9). A record behind the query waited up to 115 milliseconds. 2e5e047 finds the window's first slot with a binary search over the held buckets and reads from there. A filtered query looks the account up with get. Now 5.2 to 12.2 and 3.7 to 5.4 milliseconds, with the longest record wait at 15.7. The host ran at a load average of 28 to 63 on 16 cores.

/// no operation. The fine ring's windows lie inside the coarse ring's, so
/// no query answer changes; an account that has sent no request for the
/// length of the coarse ring releases its memory.
pub(super) fn prune(&mut self, now: Instant) {

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.

The prune reads all 1,441 coarse buckets of every pair under the write lock. With 1,000 x 40 pairs it held the lock 289.4 to 303.4 ms, once per five minutes, against 0.08 to 0.09 ms on the merge-base. Keeping the newest recorded slot per pair makes the idle check constant per pair.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reproduced: 187.9 to 201.3 milliseconds under the write lock, against 0.05 on the merge-base. In 2e5e047 the newest bucket is the back of each ring's deque, so the prune compares one slot per pair. On the same store it now takes 0.27 to 1.19 milliseconds.

Comment thread crates/core/src/metrics/collector.rs Outdated
segs.retain(|p| p.timestamp >= cutoff);
// Clock read under the lock, as in `record_segments`.
if let Ok(mut store) = self.segments.write() {
store.prune(Instant::now());

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.

Replacing this call with a no-op leaves all 32 metrics:: tests passing. The store test calls SegmentStore::prune directly. The guide, the design doc and the module doc state that this prune releases an idle account. A #[cfg(test)] prune_at(now) like query_segments_at, and a test that records, prunes at epoch plus 1,441 minutes and asserts the store is empty, would pin it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reproduced: with the segment prune in MetricsCollector::prune made a no-op, all 32 tests passed. 2e5e047 adds prune_at(now), which prune() now calls. prune_keeps_recent_segments_and_drops_them_a_day_later records, prunes at epoch plus 1,441 minutes and asserts the store holds no bucket. The no-op fails it.

// that crosses a bucket boundary between its clock read and its lock
// could overwrite the oldest in-window bucket before a reader with an
// earlier clock reads it.
let Ok(mut store) = self.segments.write() else {

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.

Reading the clock before the lock here, or before the read lock in query_segments, leaves every test passing. The comment's property rests on the lock placement alone. A clock seam on the record path would let a test hold it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reproduced for both paths. 2e5e047 moves the clock behind record_segments_with and query_segments_with, and the production paths pass Instant::now. segment_record_and_query_read_the_clock_under_the_lock passes a clock that asserts try_read and try_write on the segments lock return WouldBlock. A clock read before either lock fails it.

Comment thread docs/manuals/11-deployment-guide.md Outdated
number of accounts that sent a request in the last day, and not with the
request rate, the table count or uptime.

Releases through 0.1.13 kept one latency segment record per data-plane

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.

v0.1.14, v0.1.15 and v1.0.0 all contain segments: RwLock<Vec<SegmentPoint>> in crates/core/src/metrics/collector.rs (git grep at each tag). v0.1.14 was already released when this branch was cut. An operator on 1.0.0 reads this and skips the sizing rule. Naming the last release that ships the vector, or "releases before the one that carries this change", fixes it. The PR body has the same sentence.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

git grep at v0.1.14, v0.1.15 and v1.0.0 finds the vector in each. 03bae35 makes it every release through 1.0.0 and any later release before the one that carries this change, in the guide and in the body. 11bfdbe also gives the cost per request for each release. It is about 190 bytes through 0.1.14, and about 250 from 0.1.15 on, because each record also stores the account id. The sizing rule takes the figure of the release that runs. One detail: the branch was cut on 2026-10-13, ten days before v0.1.14. The sentence came later, on 2026-11-14.

Comment thread docs/manuals/11-deployment-guide.md Outdated

### Process Memory

The server's resident memory does not grow with the number of requests

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.

With throttling_enabled = true, resident memory grows with requests: ThrottleManager keeps a bucket per new partition key and never removes it (crates/core/src/throttle.rs:186). On a PostgreSQL server, 60,000 PutItem with new keys grew RssAnon from 28,536 kB to 56,244 kB with throttling on and not at all with it off. The paragraph also says segment memory grows with accounts. Limiting the sentence to the metrics would make it true.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Confirmed in the code: partitions at throttle.rs:186 only gains entries (entry(pk).or_insert_with at lines 325 and 402), and remove_table touches tables only. 03bae35 limits the sentence to the memory the metrics hold and adds one sentence on the throttle growth. 11bfdbe names the operations whose keys add a read and a write bucket: GetItem, PutItem, UpdateItem and DeleteItem, so reads grow the map too.

Comment thread docs/manuals/11-deployment-guide.md Outdated
flushed to the catalog, so the memory they occupy scales with the request
rate (for example six 40-byte points per GetItem, held for 60 to 120 seconds)
and not with uptime, and per-operation latency segments are summed into fixed
time buckets per account and operation, at most 111,488 bytes (109 KiB)

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.

111,488 bytes is the bucket payload. Each pair also holds its operation key, OperationRings and map slots; 111,624 bytes per pair was measured. "About" would be accurate. The same applies to docs/design/06-component-server.md:361. Line 372: after the store is dropped, live bytes fall to about 1 KB but RSS stays at its high-water mark (4,359,488 kB above start for a 1,000 x 40 store), so "holds no segment memory" describes the allocator, not the process.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Measured 111,623 bytes per pair at 1,000 x 40 and 112,137 for a single pair. After the drop, live bytes returned to the baseline while RssAnon stayed at 4,362,420 kB. With 2e5e047 the fixed figure is gone. The texts give 111,488 bytes as the bucket ceiling and about 340 bytes for a pair with one request a day. 03bae35 says the buckets return to the allocator while the resident size can stay at its high-water mark.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Correction to my reply above. The "about 340 bytes" for a pair with one request a day holds when the account sends many operations. For an account that sends one operation it's about 810 bytes. 1,000 such accounts held 810,520 bytes on a release build with a counting allocator at 5c4f613 (23 Nov). 7967ac7 gives both figures in the guide and in the design doc. It also says that a pair keeps the largest allocation it reached until a day passes with no request for it. Then the prune frees it.

Comment thread docs/design/06-component-server.md Outdated
accounts that sent a request in the last day (the 24-hour ring, 1,440 to
1,441 minutes): the metrics prune, every five minutes, drops the buckets of
an account's operation once that window holds none of its requests, and the
account once it holds no operation. The segments are recorded only for

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.

Requests refused by authorization, throttled requests and the point-in-time recovery refusal also return before the record at handler.rs:404 (lines 176, 262, 139). AccessDeniedException GetItem added no segment in a run against this branch. On line 363, the prune runs every 300 s, so an idle account is released 1,441 to about 1,446 minutes after its last request.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Both hold. 03bae35 says the segments are recorded only for requests that reach dispatch. It names authentication, authorization, throttling and the point-in-time recovery check as the refusals that add none. On the timing: a request in minute m leaves the ring at the start of minute m + 1,441, so between 1,440 and 1,441 minutes later. The prune then runs within 300 seconds. The text says 1,440 to about 1,446 minutes.

A ring now holds only the buckets of the slots that had a request, in slot order. A record first drops the buckets outside the ring's window, then adds its own. The deque grows by doubling up to the ring length and no further. So a pair that sends a request every second still holds at most 1,742 buckets, 111,488 bytes. A pair with one request a day holds two buckets.

Before this change the first request of an (account, operation) pair allocated both rings in full. On a release build with a counting allocator, 1,000 accounts x 40 operations with one request each held 4,464,933,520 bytes. Main holds 9,922,080 bytes for the same requests. With this change the same store holds 13,605,520 bytes, 340 per pair. On that store the unfiltered Last5Minutes query held the read lock between 76.7 and 80.5 milliseconds. The prune held the write lock between 187.9 and 201.3 milliseconds. Both read every slot of every ring. The query now finds the window's first slot with a binary search and reads from there (5.2 to 12.2 milliseconds). The filtered query looks the account up instead of scanning the map. The prune compares one slot per pair (0.27 to 1.19 milliseconds).

The collector's prune is now `prune_at(now)` behind `prune()`. The record and query paths take their clock through `record_segments_with` and `query_segments_with`. Tests can therefore run the production prune at a chosen time and check that the clock runs inside the lock. Before this change, a no-op segment prune and a clock read before the lock both passed every test.
LeeroyHannigan added a commit that referenced this pull request Nov 25, 2026
The base merges main at 14ade59. That brings #544 as a squash and
ten other commits: #1280, #1009, #596, #1173, #398, #428, #567, #584,
#588 and #864. The merge has no conflict. No file has changes on both
sides.
LeeroyHannigan added a commit that referenced this pull request Nov 25, 2026
The base merges main at 14ade59. That brings #544 as a squash and
ten other commits: #1280, #1009, #596, #1173, #398, #428, #567, #584,
#588 and #864.

One file conflicted: crates/engine/src/import_export.rs. #1009 moves
the body of handle_import_table to import_table in the new file
crates/engine/src/import_export/files.rs. The wasm32 build replaces
that file with a stand-in that refuses the operation.
handle_import_table keeps the enabled check and calls
files::import_table.

This branch changes the body that #1009 moves. When read_items finds a
line that it cannot read, the import keeps the items before that line.
It counts the line as one error and reads no more of the file.

The merge keeps the code of main in import_export.rs, with the doc
comment of this branch on handle_import_table. It makes the three
changes of this branch to the body in files.rs:

- The variable read holds the result of read_items: the items and the
  line that the reader cannot read.
- The loop takes the items, then that line. At that line it logs the
  line number and the fault, counts one error and ends the import.
- The comment over the FAILED status adds the date 2026-11-22, for the
  lines that the import cannot read.

The body of import_table in files.rs is now the same as the body of
handle_import_table at the head of this branch.

Git merged docs/manuals/07-upgrade-manual.md with no conflict. #398
adds its v1.1.0 entry at the top of "Behavior Changes by Release".
This branch adds its v1.1.0 entry at the end of that section.
LeeroyHannigan added a commit that referenced this pull request Nov 25, 2026
The base merges main at 14ade59. That brings #544 as a squash and
ten other commits: #1280, #1009, #596, #1173, #398, #428, #567, #584,
#588 and #864. The merge has no conflict.

Git merged crates/engine/src/lib.rs, the one file with changes on both
sides. Main compiles three modules only off wasm32 (backup,
import_export_io and private_fs), and adds the modules backup_requests
and pre_dispatch. This branch adds single_write_refusal after
deserialize_error.
LeeroyHannigan added a commit that referenced this pull request Nov 25, 2026
Main is 10 commits ahead of the branch. Two files conflicted.

docs/manuals/07-upgrade-manual.md: both sides add a v1.1.0 entry at the
same place. Both stay, main's #398 entry first.

crates/engine/src/query.rs: #544 (1ddc087) moved the Limit, enum,
parameter mix, names and number checks of a Query into
query_key_values::validate_query_request_body. That function reads the
raw body before deserialization and before the IAM decision. This branch
runs its checks in query::request_checks::check_request. The three
conflict regions take this branch's side. handle_query reads the request
through check_request, and the empty key condition, parameter usage and
ConditionalOperator checks stay in check_request_parameters.
check_request now starts with validate_query_request_body and drops its
own copies of the ReturnConsumedCapacity enum check and the Limit check.
check_request_parameters drops its copy of the parameter mix check.
The copies of #544 merged first.

The Select enum check moves out of validate_query_request_body into
validate_query_select, which check_request runs after the
FilterExpression and KeyConditionExpression checks, with the same shape
fault rule. The measured rows settle the order. An undefined filter name
(H3) and a second condition on one key attribute (B4) answer ahead of an
invalid Select. An N value that is not a number (f1 of #544) and a Limit
of 0 (L7, f3) answer ahead of it. The server's check before the IAM
decision no longer includes Select. A principal the policy denies, with
an invalid Select, now gets AccessDeniedException where main gave the
Select text. That answer is not measured.

Both PRs refuse a begins_with value that is not a string or a binary
value. This branch's parser check stays, because the measured rows put
that refusal ahead of the duplicate check (D3) and in the parse (E1,
P1). handle_query now calls refuse_begins_with_on_number (#544) for a
legacy KeyConditions request only, so a KeyConditionExpression is not
checked twice.

Two unit tests of #544 that read the Select answer from
validate_query_request_body now read it from validate_query_select.
@demohan demohan mentioned this pull request Nov 25, 2026
7 of 8 tasks
@robinnsc robinnsc mentioned this pull request Nov 25, 2026
6 of 8 tasks
robinnsc added a commit that referenced this pull request Nov 26, 2026
Moves the workspace version from 1.0.0 to 1.1.0 on every surface that
carries it: the root Cargo.toml version and its 13 exact pins, the 15
workspace entries in Cargo.lock (no third-party entry changes),
packaging/npm/package.json (the version and the five platform pins),
the four license-notice files (regenerated with cargo-about 0.9.0), and
the sample `extenddb version` and `serve` output in
docs/getting-started.md and docs/manuals/04-quickstart-setup-guide.md.

This is a minor release. Since v1.0.0, main has two features (#468,
#1009) and changes that make ExtendDB answer as DynamoDB does, which
docs/versioning.md ships in a minor release. It adds no catalog
migration (RELEASED_THROUGH stays 12, the last id), no configuration
key and no backup format version.

Upgrade manual, Behavior Changes by Release: v1.1.0 entries for #468
(AT_TIMESTAMP, and the GetShardIterator answers it changes), #503,
#544, #567, #765 and #774, #588, #596, #690, #1144, #1173 and #1194,
next to the existing entries for #398 and #526. The #526 entry now
gives the old TransactWriteItems mismatch message, and the entries are
in PR order. Current Status, the General Upgrade Procedure and the
Rollback Procedure cover 1.0.0 to 1.1.0: no migrate step, and a
rollback runs the 1.0.0 binary on the same catalog, with the two
limits the manual names (#526 tokens, and 1.0.0's catalog-check
--fix). The rollback note of the KEK-file switch says that 1.0.0
serves a switched catalog.

docs/manuals/11-deployment-guide.md: a sentence about the release
before the one that carries #398 is gone.

Signed-off-by: Scott Robinson <robinnsc@amazon.com>
robinnsc added a commit that referenced this pull request Nov 26, 2026
Moves the workspace version from 1.0.0 to 1.1.0 on every surface that
carries it: the root Cargo.toml version and its 13 exact pins, the 15
workspace entries in Cargo.lock (no third-party entry changes),
packaging/npm/package.json (the version and the five platform pins),
the four license-notice files (regenerated with cargo-about 0.9.0), and
the sample `extenddb version` and `serve` output in
docs/getting-started.md and docs/manuals/04-quickstart-setup-guide.md.

This is a minor release. Since v1.0.0, main has two features (#468,
#1009) and changes that make ExtendDB answer as DynamoDB does, which
docs/versioning.md ships in a minor release. It adds no catalog
migration (RELEASED_THROUGH stays 12, the last id), no configuration
key and no backup format version.

Upgrade manual, Behavior Changes by Release: v1.1.0 entries for #468
(AT_TIMESTAMP, and the GetShardIterator answers it changes), #486,
#503, #544, #567, #765 and #774, #588, #596, #690, #963, #1144, #1173,
#1194 and #1375, next to the existing entries for #398, #526 and
#1166. The #526 entry now gives the old TransactWriteItems mismatch
message, and the entries are in PR order. Current Status, the General
Upgrade Procedure and the Rollback Procedure cover 1.0.0 to 1.1.0: no
migrate step, the #1166 checks before a PostgreSQL upgrade, and a
rollback runs the 1.0.0 binary on the same catalog, with the two
limits the manual names (#526 tokens, and 1.0.0's catalog-check
--fix). The rollback note of the KEK-file switch says that 1.0.0
serves a switched catalog.

docs/manuals/11-deployment-guide.md: a sentence about the release
before the one that carries #398 is gone.
robinnsc added a commit that referenced this pull request Nov 27, 2026
Moves the workspace version from 1.0.0 to 1.1.0 on every surface that
carries it: the root Cargo.toml version and its 13 exact pins, the 15
workspace entries in Cargo.lock (no third-party entry changes),
packaging/npm/package.json (the version and the five platform pins),
the four license-notice files (regenerated with cargo-about 0.9.0), and
the sample `extenddb version` and `serve` output in
docs/getting-started.md and docs/manuals/04-quickstart-setup-guide.md.

This is a minor release. Since v1.0.0, main has three features (#468,
#1009, #1449) and changes that make ExtendDB answer as DynamoDB does, which
docs/versioning.md ships in a minor release. It adds no catalog
migration (RELEASED_THROUGH stays 12, the last id), no configuration
key and no backup format version.

Upgrade manual, Behavior Changes by Release: v1.1.0 entries for #468
(AT_TIMESTAMP, and the GetShardIterator answers it changes), #486,
#503, #544, #567, #765 and #774, #588, #596, #690, #963, #1144, #1173,
#1194, #1375 and #1522, next to the existing entries for #398, #526,
#1166, #1449 and #1523. The #526 entry now gives the old
TransactWriteItems mismatch message, the #1523 heading takes the
v1.1.0: prefix, and the entries are in PR order. Current Status, the General
Upgrade Procedure and the Rollback Procedure cover 1.0.0 to 1.1.0: no
migrate step, the #1166 checks before a PostgreSQL upgrade, and a
rollback runs the 1.0.0 binary on the same catalog, with the two
limits the manual names (#526 tokens, and 1.0.0's catalog-check
--fix). The rollback note of the KEK-file switch says that 1.0.0
serves a switched catalog.

docs/manuals/11-deployment-guide.md: a sentence about the release
before the one that carries #398 is gone.
robinnsc added a commit that referenced this pull request Nov 27, 2026
Moves the workspace version from 1.0.0 to 1.1.0 on every surface that
carries it: the root Cargo.toml version and its 13 exact pins, the 15
workspace entries in Cargo.lock (no third-party entry changes),
packaging/npm/package.json (the version and the five platform pins),
the four license-notice files (regenerated with cargo-about 0.9.0), and
the sample `extenddb version` and `serve` output in
docs/getting-started.md and docs/manuals/04-quickstart-setup-guide.md.

This is a minor release. Since v1.0.0, main has three features (#468,
#1009, #1449) and changes that make ExtendDB answer as DynamoDB does, which
docs/versioning.md ships in a minor release. It adds no catalog
migration (RELEASED_THROUGH stays 12, the last id), no configuration
key and no backup format version.

Upgrade manual, Behavior Changes by Release: v1.1.0 entries for #468
(AT_TIMESTAMP, and the GetShardIterator answers it changes), #486,
#503, #544, #567, #765 and #774, #588, #596, #690, #963, #1144, #1173,
#1194, #1375 and #1522, next to the existing entries for #398, #526,
#1166, #1449 and #1523. The #526 entry now gives the old
TransactWriteItems mismatch message, the #1523 heading takes the
v1.1.0: prefix, and the entries are in PR order. Current Status, the General
Upgrade Procedure and the Rollback Procedure cover 1.0.0 to 1.1.0: no
migrate step, the #1166 checks before a PostgreSQL upgrade, and a
rollback runs the 1.0.0 binary on the same catalog, with the two
limits the manual names (#526 tokens, and 1.0.0's catalog-check
--fix). The rollback note of the KEK-file switch says that 1.0.0
serves a switched catalog.

docs/manuals/11-deployment-guide.md: a sentence about the release
before the one that carries #398 is gone.

docs/troubleshooting.md: the bus error entry names 1.0.0 as the release
that has the bug, so its line carries a version-literal-ok marker.
LeeroyHannigan added a commit that referenced this pull request Nov 27, 2026
* chore(release): bump version to 1.1.0

Moves the workspace version from 1.0.0 to 1.1.0 on every surface that
carries it: the root Cargo.toml version and its 13 exact pins, the 15
workspace entries in Cargo.lock (no third-party entry changes),
packaging/npm/package.json (the version and the five platform pins),
the four license-notice files (regenerated with cargo-about 0.9.0), and
the sample `extenddb version` and `serve` output in
docs/getting-started.md and docs/manuals/04-quickstart-setup-guide.md.

This is a minor release. Since v1.0.0, main has three features (#468,
#1009, #1449) and changes that make ExtendDB answer as DynamoDB does, which
docs/versioning.md ships in a minor release. It adds no catalog
migration (RELEASED_THROUGH stays 12, the last id), no configuration
key and no backup format version.

Upgrade manual, Behavior Changes by Release: v1.1.0 entries for #468
(AT_TIMESTAMP, and the GetShardIterator answers it changes), #486,
#503, #544, #567, #765 and #774, #588, #596, #690, #963, #1144, #1173,
#1194, #1375 and #1522, next to the existing entries for #398, #526,
#1166, #1449 and #1523. The #526 entry now gives the old
TransactWriteItems mismatch message, the #1523 heading takes the
v1.1.0: prefix, and the entries are in PR order. Current Status, the General
Upgrade Procedure and the Rollback Procedure cover 1.0.0 to 1.1.0: no
migrate step, the #1166 checks before a PostgreSQL upgrade, and a
rollback runs the 1.0.0 binary on the same catalog, with the two
limits the manual names (#526 tokens, and 1.0.0's catalog-check
--fix). The rollback note of the KEK-file switch says that 1.0.0
serves a switched catalog.

docs/manuals/11-deployment-guide.md: a sentence about the release
before the one that carries #398 is gone.

docs/troubleshooting.md: the bus error entry names 1.0.0 as the release
that has the bug, so its line carries a version-literal-ok marker.

* docs(upgrade): add the v1.1.0 entry of #1290, put #1349's in order

#1290 merged after this branch was rebased. It changes the answer to a
request with no Authorization header, so it gets a v1.1.0 entry. The
merge of main put the #1349 entry after the #1523 entry. It moves to
the place of its number, beside the new #1290 entry.

---------

Co-authored-by: Lee Hannigan <29015211+LeeroyHannigan@users.noreply.github.com>
jgaul3 pushed a commit to jgaul3/extenddb that referenced this pull request Dec 2, 2026
…1482)

* fix(core): read the latency segment clock through web_time

segments.rs imported std::time::Instant, and collector.rs and
collector_query.rs pass web_time::Instant values to SegmentStore::new
and to its record, prune and query methods. On the WebAssembly target
the two types differ, so extenddb-core did not compile there. The
WebAssembly workflow has failed on main since ExtendDB#398 merged (8e17259).
On every other target web_time re-exports std::time, so native builds
compile the same code.

* test(core): read the metrics test clocks through web_time

The core step of the WebAssembly workflow builds the library tests of
extenddb-core for wasm32. collector_tests.rs gave record_segments_with
and query_segments_with a clock that returns std::time::Instant.
segments_tests.rs and segments_bound_tests.rs passed std::time::Instant
values to SegmentStore. These methods take web_time::Instant, so the
test build stopped with 54 mismatched types errors. The three files now
import Instant from web_time, as collector.rs does. web_time re-exports
std::time::Duration on every target, so the two segment test files take
Duration from web_time too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v1 Needed for the 1.0 release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Bound in-memory latency segment retention under sustained request rate

4 participants