Skip to content

feat: add StartBulkPutItems and the bulk operation APIs - #874

Open
LeeroyHannigan wants to merge 92 commits into
mainfrom
feat/bulk-put-items
Open

LeeroyHannigan wants to merge 92 commits into
mainfrom
feat/bulk-put-items

Conversation

@LeeroyHannigan

@LeeroyHannigan LeeroyHannigan commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

What

This pull request adds the four bulk operations to ExtendDB: StartBulkPutItems, DescribeBulkOperation, ListBulkOperations and CancelBulkOperation. A bulk put reads newline-delimited DynamoDB JSON from the objects under an input bucket and prefix. It writes each item into an existing table with PutItem semantics, in the background, and reports the rows that fail under an output bucket and prefix.

The server configuration selects one of two stores for those buckets with [bulk] store. The S3 store reads and writes buckets in AWS S3 or in an S3-compatible service, with the server's own AWS credentials. The filesystem store maps each bucket to a directory in the caller's account subtree beneath one root on the server.

The SQLite and PostgreSQL backends run bulk operations. On the MongoDB and Cassandra backends the four operations answer ValidationException.

The branch holds 81 commits and 11 merges of main on top of main at 8c643330c. The six commits below carry one concern each. The commits after them answer the reviews, and the Commits section lists each merge with the resolution of its conflicts. The merges take main at d35d8601a, 3033e0906, 95425f5e8, 4c4c533c9, 85c584393, 81e3ebe4a, db813699a, a60c2b9f3, 7786b9c33, c2e9a32b0 and 8c643330c.

Changes since the last review

Since 27bcbbcb4, the head of 20 Nov, these commits changed the branch:

  • bd0ce3618 merges main at 8c643330c, with no conflict.
  • 661046895 answers a missing table before the Invalid Request: checks of Start. For a Start on a table that does not exist, DynamoDB answers ResourceNotFoundException (measured 2026-11-23, twice each). The answer is the same whatever fault the token, the output encryption pair, the OutputType or the output prefix also carry. ExtendDB answered those faults first. The checks now run after the table lookup, and one table test sends the seven measured shapes to a missing table. Two orders among ExtendDB's own refusals change with the move: ION and a missing store now answer before a bad prefix.
  • 0079bd9b9 runs the engine's bulk_put:: tests with their 15 PostgreSQL cases in the run-postgres-storage-tests job. No job set EXTENDDB_TEST_PG_CONNECTION_STRING for the engine crate, so those cases skipped in every CI run.
  • 4e5331cbd names a cap under 0.1 GiB in bytes in the SizeLimitExceeded and InputObjectTooLarge messages, where a 10-byte quota read 0.0 GB. The test asserts the whole message for a byte figure and a GiB figure.
  • 288105959 drops a false sentence from the doc comment of validate_configuration_size.

This body now names #368 and #542 beside migration 13, and #368 beside U+0000 on PostgreSQL. It also names #1331 beside the daemon's working directory, the two follow-up issues, and the runs at the final head.

Why

A user loads many items into a table that already serves traffic. They write the items to a bucket as newline-delimited DynamoDB JSON and start a bulk put. Then they poll DescribeBulkOperation until the operation ends, and read the error report for the rows that failed. Code written for these operations also handles ResourceInUseException when another operation runs on the table.

On main the four operations answer UnknownOperationException, so that code cannot run against ExtendDB. With this change, that code gets DynamoDB's request and response shapes, statuses, error texts and report layout. The list under Differences from DynamoDB gives the exceptions.

Commits

  1. feat(core): add the bulk operation types, ARNs and limits adds the request and response types of the four operations, the bulk [limits] keys and the bulk metric names. The server and the engine share its ARN parsing.
  2. feat(s3,config): add the S3 client crate and the [bulk] configuration adds crates/s3 (extenddb-s3), which opens one store's S3 clients with the standard AWS credential chain, and the [bulk] section that selects the store.
  3. feat(storage): add the bulk operation store and the batched put adds the bulk_operations migration on SQLite and PostgreSQL, the BulkOperationStore trait and its two SQL implementations, and the batched put with its row outcome ledger. The migration is number 8 in this commit and 13 since the merge of main at 95425f5e8. The put path that PutItem and the bulk runner share moves into one module in this commit.
  4. feat(engine,server): add StartBulkPutItems and the bulk operation APIs adds the four handlers, the runner and its two workers, and the filesystem and S3 stores. The authorization of the operations and of their S3 actions is in this commit, with the server code that starts and stops the bulk workers. The engine and the server are one commit because the server builds the engine's OperationContext, which gains the bulk fields.
  5. test: add the bulk put suite and the S3 bulk store job adds the Python suite in tests/bulk_put, the --bulk-store option of devtools/run-tests, and a CI job against an S3-compatible service.
  6. docs: document bulk put items adds a usage guide chapter, admin guide sections, security model entries, a differences page section, troubleshooting entries and an upgrade manual section.

cargo check --workspace --all-targets passes on each commit with Rust 1.97.0. The S3 and configuration commit carries the whole Cargo.lock. On that commit and on the storage commit, cargo prunes the lock entries that only later manifests use, so --locked fails on those two. The storage commit has three dead-code warnings for items that the engine and server commit uses, so cargo clippy -- -D warnings fails on it alone.

The merge of main at d35d8601a follows the six commits. It resolves the conflicts with #672, #466, #875, #847 and #700, and its message lists each resolution. Two commits follow the merge. One sets EXTENDDB_TEST_BACKUP_STORE in the S3 bulk suite job, which devtools/run-tests requires since #700. The other lists each parse-level cause in the usage guide with its report message. The merge of main at 3033e0906 brings in #868, whose new Cassandra test calls DataEngine::put_item and now passes the row marker.

The merge of main at 95425f5e8 (c913cfa55) lists the resolution of each conflicted file in its message. Main holds migrations 8 to 12, so bulk_operations moves to 13. These commits follow it:

  • 9ac711b83 updates the bulk put code for the interfaces that main changed in files that merged without a conflict. Examples are the account argument of MetricsCollector::record (fix(metrics): keep each account's metrics apart #955), the row marker in nine test calls of put_item on main, and the OperationContext fields of each side.
  • bf5adee8a writes 13 for the bulk operations migration in comments and tests.
  • 56e9bd5de gives extenddb-s3 the package metadata that main's crates.io packaging checks (build: make the workspace crates packageable for crates.io #927).
  • fadad1597 regenerates the four license notice files for the merged Cargo.lock.
  • daf0fd0a6 leaves each StartBulkPutItems TableName that starts with arn: to the bulk checks. Since fix(server): check table names, index names and ARNs before authorization #830, main checks table names and ARNs in table_name_gate before authorization. A bare name still gets the gate's pattern check.
  • 5a12f1574 adds a blank line before a heading in the upgrade manual.
  • 7526710ce compiles the blowfish crate with opt-level = 3 in debug and test builds. The harness of the bulk put runner tests bootstraps a SQLite catalog, and the bootstrap hashes a password with bcrypt at cost 12. bcrypt's key expansion runs in blowfish. On 5a12f1574, both run-tests jobs stopped at their 15-minute limit.

The merge of main at 4c4c533c9 (e78692f73) regenerates the four license notice files for the merged Cargo.lock. In that commit of main, #857 raises the minimum Rust version to 1.91.1, so run-tests runs on stable and on 1.91.1.

The merge of main at 85c584393 (5997dce1d) keeps this branch's entry on bulk operations and resource tags in the admin guide. The entries around it take the SearchVectors index ARN text of #999.

The merge of main at 81e3ebe4a (17527bca7) keeps both sentences of the test-util feature comment in crates/storage/Cargo.toml. In two paragraphs of the upgrade manual it keeps main's wording with this branch's count of 13 migrations. The merge of main at db813699a (bf7fb9458) takes the 0.1.15 version pins (#1069), moves extenddb-s3 to 0.1.15 in Cargo.lock and regenerates the four license notice files. The merge of main at a60c2b9f3 (577cc2d71) keeps the stdin argument of _run_extenddb from main and its cwd argument from this branch in tests/lifecycle_helpers.py.

The merge of main at 7786b9c33 (103bedd9f) takes version 1.0.0 (#1107). It pins extenddb-s3 to =1.0.0 with the other crates, updates Cargo.lock and regenerates the four license notice files.

c6f19018e merges main at c2e9a32b0, which brings #1133. Release 1.0.0 shipped from that commit without this branch, so af4f030bf puts back four 1.0.0 upgrade sentences that e2654c4bd rewrote for migration 13. Both upgrade manual entries of this branch now name v1.1.0, because docs/versioning.md puts a breaking catalog migration in a minor release. Current Status now says what migration 13 changes for a rollback to 1.0.0. On PostgreSQL and SQLite it is breaking, so a 1.0.0 server refuses the migrated catalog, and a rollback restores the backup. MongoDB and Cassandra record it as not applicable, and 1.0.0 serves those catalogs with a warning.

The commits after af4f030bf answer demohan's reviews of 8 and 19 Nov. The summary comments on this PR list them by item. bd0ce3618 merges main at 8c643330c without a conflict. Changes since the last review lists the four commits after it.

feat(core): add the bulk operation types, ARNs and limits

What it adds

crates/core now has the request and response types of StartBulkPutItems, DescribeBulkOperation, ListBulkOperations and CancelBulkOperation, with the member names of the API model. The description adds one member of ExtendDB's own, DroppedReportRecordCount. An enum value outside its set fails deserialization with a ValidationException, as in the existing types.

The arn module parses a bulk operation ARN, and resolves a TableName written as a table ARN to the bare table name. The server's authorization layer and the engine's handlers call the same functions, so the server evaluates a policy against the resource that the handler serves.

LimitsConfig has 16 new bulk keys, each with a serde default. The new MetricName variants are BulkOperationsStarted, BulkOperationsFinished, BulkPutItemsWritten and BulkReportRecordsDropped. The new QuerySource variants, BulkClaim and BulkRetention, name the two bulk workers. No request reaches this code before the engine and server commit.

Decisions to review

  • The ARN checks run in the order that the service applies them (measured). The shape comes first, then the account and the region, then the partition, the service and the operation id. An ARN of another account gets the answer for another account even when it carries a malformed id. As a result, a caller learns nothing about the ids of another account.
  • A TableName that is a well-formed table ARN of another account answers AccessDeniedException, Access is denied, before the server reads any policy. A table ARN of the caller's account in another region answers ValidationException with 1 validation error detected: Invalid AWS region in '{arn}'. Both are the texts that the service answers (measured).
  • Five limit defaults follow the service: 50,000 input objects for each operation and 5 GiB for each object. The third, max_bulk_input_bytes, defaults to 1 TiB, a ceiling over the documented quota of each tier (100 GiB for STANDARD, 1 TiB for ACCELERATED). The fourth is 5 non-terminal operations of an account in each PerformanceTier, and the fifth is 1,024 characters for a ClientToken. The other defaults are ExtendDB's own. A terminal record stays for 30 days. A process runs 4 operations at once, at most 2 for one account, under a 60-second lease. A runner checkpoints every 25 rows and writes up to 25 rows in each storage transaction.
  • bulk_put_write_units_per_second, the ceiling on bulk writes in one process, defaults to 80,000 write units a second. The default equals per_account_max_wcu, the per-account write ceiling of the request path.

Differences from DynamoDB

  • The operation limits are [limits] keys, where DynamoDB has service quotas.
  • bulk_operation_retention_days sets how long a terminal operation stays describable.
feat(s3,config): add the S3 client crate and the [bulk] configuration

What it adds

crates/s3 (extenddb-s3) opens one store's S3 clients from three settings: region, endpoint_url and force_path_style. The clients sign with the standard AWS credential chain. The crate resolves the chain once at startup and logs the outcome under the store's name. Temporary keys that the SDK cannot renew get a warning. Without an endpoint_url, the crate also sends one STS GetCallerIdentity request at startup. The request runs in a task of its own with a 5-second bound, and the crate logs the identity that the credentials sign as.

The clients follow the region redirects that AWS S3 sends. They send a call that fails with a transient fault again after 1 second. The wait doubles up to 30 seconds, and no new try starts later than 120 seconds after the first one.

crates/config reads [bulk]. store is filesystem, the default, or s3. [bulk.filesystem] path is the root of the filesystem store. [bulk.s3] has region (default [server] region), endpoint_url, force_path_style and allow_insecure_endpoint. The console settings page lists the bulk store settings and the bulk limits.

The workspace manifest adds the crate and enables credentials-login on aws-config, so the credential chain resolves a profile that aws login wrote. It names aws-sdk-sts 1.97.0 and aws-credential-types 1.2.11 directly, at the versions already in Cargo.lock. For the engine's row parser, it enables the unbounded_depth feature of serde_json. The minimum Rust version stays at 1.88, and aws-config 1.8.13 and aws-sdk-s3 1.122.0 stay at the versions that main pins. Cargo.lock gains 27 packages and changes the version of none, and the commit updates the four license notice files.

Decisions to review

  • Credentials come only from the standard AWS credential chain. [bulk.s3] refuses the six credential key names, such as access_key_id and aws_secret_access_key, with a message that names the chain. The configuration file carries no secret.
  • A plain http endpoint_url whose host is not a loopback form (127.x.y.z, ::1 or localhost) refuses startup unless allow_insecure_endpoint = true. With that key set, the server accepts the endpoint and logs a warning. The backup store applies this rule, with these loopback forms.
  • The clients send their requests to AWS S3 or to endpoint_url alone. They ignore an endpoint from the environment or from an AWS profile, such as an AWS_ENDPOINT_URL that points DynamoDB clients at ExtendDB.
  • The identity check never delays startup. It logs one line: the identity, a refusal by STS, a server clock more than 15 minutes off, or a check that could not complete. It runs only against AWS S3, because an S3-compatible service has no STS.

Differences from DynamoDB

This commit dispatches nothing. The first entry under Differences from DynamoDB comes from the store that [bulk] store selects. DynamoDB reads and writes S3 as the caller, and the S3 store signs with the server's credentials.

feat(storage): add the bulk operation store and the batched put

What it adds

Migration 13, bulk_operations, adds five tables through the migration ledger. On PostgreSQL the catalog database gets bulk_operations, bulk_operation_input_files and bulk_operation_report_records. The data database gets bulk_row_outcomes and bulk_write_owners, beside the items that they record. SQLite gets all five in its one database, and MongoDB and Cassandra record the migration as not applicable. Every statement is CREATE ... IF NOT EXISTS, so a second run changes nothing. docs/schema/postgres.txt and docs/schema/sqlite.txt gain the new objects and lose none. Migration 8 on main is restore_progress from #740. Two open pull requests also add a migration 13: #542 (gsi_pending_table_claim) and #368 (escape_control_chars). Of the three, the second to merge takes 14 and the third takes 15, in registry.rs and the four backend migrations/mod.rs files.

crates/storage adds the BulkOperationStore trait, which StorageEngine now requires. Its methods are the storage steps of an operation: start, read, list, cancel, claim, checkpoint, read report records in pages, finish and purge. The backends implement only these steps. The engine implements the lifecycle around them, with the claim policy, batching, resume, rendering and the terminal transitions. A contract suite behind the test-util feature runs the same cases on SQLite and PostgreSQL.

DataEngine gains put_items_batch, a required method. It applies a batch of rows in one transaction. In that transaction it checks the write owner and prunes the ledger rows the last checkpoint covers. It then records each marked row's outcome in bulk_row_outcomes, with the size of the item that the row replaced. DataEngine::put_item keeps the signature it has on main. MongoDB and Cassandra refuse the bulk methods with ValidationException, Bulk operations are not supported on this storage backend.

The put path moves to crates/engine/src/put_item/payload.rs. handle_put_item and the bulk runner both call its resolve_put_condition and validate_put_payload, and handle_put_item writes through its apply_put. validate_put_item in crates/core has no caller left, and the commit deletes it. The engine's Cargo.toml is in this commit because the put helper's tests need the SQLite engine as a dev-dependency. The manifest adds the dependencies that the engine and server commit uses: ruzstd, md-5, flate2, rustix on unix, extenddb-s3 and aws-sdk-s3.

Decisions to review

  • A run applies each row once. A batch records every row that it applies, plain or conditional, in bulk_row_outcomes in its own data transaction. A resumed run reads the rows recorded past its checkpoint and accounts for them from the ledger. It does not write them again, so a client write that came after the row keeps its value. The ledger is in the data database, beside the items, because the catalog and the data tables can be separate databases on PostgreSQL. No transaction then covers both.
  • Each claim records itself in bulk_write_owners before its first batch. A batch whose marker names another owner writes nothing and answers StorageError::Transient. A runner that lost its lease thus cannot commit a late batch.
  • On PostgreSQL and SQLite, put_item and put_items_batch call one in-transaction row helper. For that reason this commit restructures the single-item put path of both backends.
  • A unique partial index on (account_id, table_id) over IN_PROGRESS and CANCELLING allows one non-terminal operation for each table. The start transaction answers a second start at once.
  • The token index stores the SHA-256 hash of each ClientToken, for each account, so the token itself never enters an index. A token replays its operation for eight hours from the operation's start.
  • bulk_operations has no foreign key to tables. A run ends FAILED when DeleteTable deletes its table, and the operation stays describable until retention purges it.
  • bulk_operation_report_records.record is TEXT on PostgreSQL, where jsonb would refuse a DynamoDB string that contains U+0000.
  • bulk_operations.client_token is BYTEA on PostgreSQL and holds the token's UTF-8 bytes, because TEXT cannot store U+0000, which DynamoDB accepts in a token.
  • On PostgreSQL the start transaction waits at most 200 ms at a time for the account's advisory lock. It takes the table row with FOR SHARE NOWAIT. The server never accepts both a Start and an UpdateTable that creates an index on the same table. Leases use the database clock (clock_timestamp()), and bulk store transactions run under a 10-second idle_in_transaction_session_timeout. The backend retries a batch that PostgreSQL aborts as a deadlock victim, after a jittered wait.
  • On SQLite the start and the index creation read each other's rows inside BEGIN IMMEDIATE transactions, so the database write lock orders them.
  • When a connection returns to the SQLite engine pool or catalog pool, the pool rolls back a transaction still open on it. A begin_with future dropped after its BEGIN IMMEDIATE ran left such a transaction, and the connection then refused its next begin_with and kept the database write lock.
  • PutItem changes order. resolve_put_condition runs the nesting-depth check of the expression values before the table lookup, as DeleteItem does. A request with an over-deep expression value now gets that ValidationException when its table is missing, where main answers ResourceNotFoundException. When its item is also invalid, it gets the nesting-depth error. On main that request gets the item's error.

Differences from DynamoDB

  • ExtendDB always refuses a second start on a table with a running operation at once, with ResourceInUseException. DynamoDB can also accept it and fail it later.
  • The MongoDB and Cassandra backends refuse the four operations.
feat(engine,server): add StartBulkPutItems and the bulk operation APIs

What it adds

The engine (crates/engine/src/bulk_put) dispatches the four operations.

  • StartBulkPutItems checks a request in seven steps. The first four are body deserialization with the model's constraints, this server's bounds on the stored configurations, feature support and the bulk store. Then come the table lookup, the service's Invalid Request: checks, and the start transaction. A request that is wrong at two steps gets the earlier step's error. A missing table answers ResourceNotFoundException before any Invalid Request: check, as DynamoDB does (measured 2026-11-23). Start answers IN_PROGRESS with no byte member. Before it reads a row, the operation's first claim checks s3:ListBucket, the input bucket and its owner and the output KMS key, then lists the input.
  • A retry with the same ClientToken and the same parameters returns the existing operation. A retry with other parameters gets IdempotentParameterMismatchException.
  • A Start without a ClientToken answers DynamoDB's Member must not be null refusal. The SDKs fill one in.
  • DescribeBulkOperation and CancelBulkOperation check the operation ARN in layers and answer an ARN of another account or region without a storage read. ListBulkOperations pages newest first, 10 operations to a page by default and at most 25.
  • A claim loop in each server claims runnable operations every second. It runs up to bulk_operation_worker_concurrency operations in the process and bulk_operation_worker_per_account for one account. A retention worker purges terminal operations older than bulk_operation_retention_days, at startup and then daily, 1,000 operations at a time.
  • The runner reads the input objects one at a time, in the byte order of their keys. It checks each row with the validation and condition handling of PutItem, through the shared put path. It writes up to bulk_put_write_batch_rows rows in each storage transaction. After every bulk_put_batch_size rows and at the end of each file, it checkpoints its cursor, counters, usage and report records. Each checkpoint renews the runner's lease.
  • A row with an item fault fails alone, with the PutItem text in its report record, and the load continues. A line that the parser cannot read abandons the rest of its file.
  • The runner writes the report records to gzip objects after it reads the last row and writes the final checkpoint. It writes each object once, complete, then the manifest, then the terminal status. Each requested kind gets its own sequence of objects, rolled at 200 MiB of compressed output. The runner drops the records past max_bulk_report_records or max_bulk_report_bytes and counts them in DroppedReportRecordCount on Describe and in the BulkReportRecordsDropped metric.
  • Two token buckets pace the writes, in 1 KB write units: one for the process, from bulk_put_write_units_per_second, and one for each operation, from its MaxWriteRequestUnits.
  • UpdateTable refuses a new global secondary index while an operation on the table is IN_PROGRESS or CANCELLING, with the service's text. Start refuses a table with an index that is not ACTIVE.

The two stores:

  • The filesystem store reads and writes {root}/{account id}/{S3Bucket}/.... It opens every input file and report directory by a walk from a handle on the account directory, with openat and O_NOFOLLOW. The walk never follows a symbolic link out of the account subtree. It needs unix, so on other targets Start refuses the filesystem store. Report files get mode 0600 and report directories 0700.
  • The S3 store lists the input on the operation's first claim with ListObjectsV2, 1,000 keys to a page. It reads each object with ranged GETs of 8 MiB. Each GET carries If-Match with the ETag from the listing, so a read takes bytes only from the object listed. The store writes each report object as a multipart upload with the requested server-side encryption.
  • The S3 store sends an S3BucketOwner other than the caller's ExtendDB account id as x-amz-expected-bucket-owner, and S3 decides.
  • The S3 store maps S3 errors to the service's FailureCode values, with S3's message and request ids. A code about the server's own credentials, account or clock, such as ExpiredToken, answers InternalServerError, and the server logs it.

The server (crates/server) and the CLI (crates/app):

  • Start needs two actions: dynamodb:StartBulkOperation on arn:aws:dynamodb:<region>:<account-id>:bulk-operation/*, then dynamodb:BulkPutItems on the table ARN. The server evaluates Describe and Cancel on the operation ARN, and List on the bulk-operation/* wildcard.
  • A bulk operation reads and writes through three S3 actions. The server evaluates them for the caller against the caller's ExtendDB policies, on both stores. It checks s3:ListBucket on each claim that lists the input, and s3:GetObject before the runner opens each input object and at each checkpoint. It checks s3:PutObject at the first record of each report kind, before each report object and before the manifest. Developer mode evaluates no S3 action.
  • The server resolves [bulk] once at startup. Without the section, bulk operations are off, except in developer mode, which uses a filesystem store at ./.extenddb/buckets. The server creates the filesystem store's account directories at startup, when the management API creates an account, and on an operation's first claim. It warns when the S3 store's credentials are an access key that it also accepts from its clients.
  • extenddb init writes the [bulk] examples and the bulk [limits] keys as comments.
  • BulkOperationsStarted, BulkOperationsFinished and BulkPutItemsWritten count the starts, the terminal statuses and the items written. BulkReportRecordsDropped counts the report records that an operation dropped past the caps.

Decisions to review

  • The four operations stay out of the cross-account pre-check of main (crates/server/src/authz_resource/cross_account.rs). The bulk request path answers an ARN of another account itself, before the server reads any policy. Start answers such a TableName with Access is denied, and Describe and Cancel answer such an operation ARN with the IAM denial text, both as measured.
  • The bulk workers run in the worker set of main and stop with it. When the server stops its workers, the claim loop aborts a run still running after one second. The run keeps its lease until the lease lapses. A later claim resumes it from its last checkpoint, with its applied rows in the ledger.
  • A transient storage or store fault leaves the operation to resume from its last checkpoint. After ten claims in a row find the checkpoint where the claim before them found it, the operation ends FAILED, or CANCELLED when a cancel is pending.
  • Start records the caller on the operation. The later S3 checks read the caller's identity policies, group policies and permissions boundary when they run, and use the session data recorded at Start. A policy change takes effect at the next check, and a session that expires during a load does not fail it.
  • On the S3 store, the caller's ExtendDB policies and the buckets that the server's credentials reach are the only separation between ExtendDB accounts. A caller whose policies allow the S3 actions on * reaches every bucket that those credentials reach. The security model tells operators to grant each account's callers that account's buckets only.
  • serve makes a relative [bulk.filesystem] path absolute against the directory it starts in, at config load and before it daemonizes, as it does the backup store path. A daemonized serve changes to /, as on main. fix(serve): keep the start directory as the daemon's working directory #1331 keeps the start directory as the daemon's working directory. It is the separate pull request that review item 13 asked for. crates/config/src/bulk.rs repeats, in absolute(), the tilde expansion and join of BackupConfig::make_paths_absolute. One shared helper would change backup configuration code that this PR does not touch.
  • The log filter keeps the aws_config target at warn at every level, since the SDK's profile loader logs the access key id at info.
  • A row's condition gets the attribute name size check that PutItem applies to ExpressionAttributeNames and ExpressionAttributeValues, before the runner resolves the condition.

Differences from DynamoDB

Most entries under Differences from DynamoDB come from this commit. The exceptions are the operation limits and the retention period, which the core commit sets. The storage commit adds the other two: the synchronous refusal of a second start and the refusal on MongoDB and Cassandra.

test: add the bulk put suite and the S3 bulk store job

What it adds

tests/bulk_put sends the four operations to a running server as SigV4-signed requests. It covers validation, the lifecycle, idempotency, listing, the store rules, authorization and the S3 actions that an operation checks for its caller. The suite writes its inputs to, and reads its reports from, the store that EXTENDDB_TEST_BULK_STORE names. devtools/run-tests sets that variable from its new --bulk-store option. devtools/run-tests-bulk-store.sh writes the matching [bulk] section. On MongoDB and Cassandra the suite checks that the server refuses the bulk requests, then skips.

.github/workflows/integration-s3.yml starts an S3-compatible service in a container, pinned by digest. It runs the engine's bulk store contract tests and the S3 smoke test against that service. Then it runs the suite on a PostgreSQL server whose [bulk] store is s3. integration.yml calls the workflow as a job, and its integration gate requires that job.

The provisioned test user may call s3:ListBucket, s3:GetObject and s3:PutObject. A CLI lifecycle test checks that a daemonized serve makes a relative [bulk.filesystem] path absolute against its start directory and loads a row from a file beneath it. devtools/run-tests no longer fails the CLI lifecycle stage when --filter selects none of its tests.

Decisions to review

  • The suite signs its own requests with botocore's SigV4 signer, as tests/test_import_export.py does.
  • On MongoDB and Cassandra the suite asserts the refusal before it skips, so a backend that answers in another way fails the suite.
  • devtools/run-tests-bulk-store.sh accepts only an S3 endpoint on localhost or 127.0.0.1, from EXTENDDB_TEST_S3_ENDPOINT, with the keys from EXTENDDB_TEST_S3_ACCESS_KEY_ID and EXTENDDB_TEST_S3_SECRET_ACCESS_KEY.

Differences from DynamoDB

This commit adds no difference. The suite checks the behaviour that the other commits add.

docs: document bulk put items

What it adds

  • docs/manuals/03-usage-guide.md gains a Bulk Put Items chapter. It covers request members, the input on each store, the four operations, the status machine and failure messages. Its other sections cover counters, the error report, row errors, one operation per table, idempotency and configuration.
  • docs/manuals/05-admin-guide.md documents [bulk], the S3 store's AWS credentials and the permissions they need, and the startup log lines. It gives the rule for plain http endpoints, the bulk [limits] keys and report file reclaim. A new Bulk Operations chapter covers the operator's cancel and the faults during a load.
  • docs/manuals/10-security-model.md lists the five DynamoDB actions with their resources, and the three S3 actions with their condition keys. It also says what a policy variable in an S3 Resource matches on each store.
  • docs/differences-from-dynamodb.md gets a Bulk Operations table, and docs/troubleshooting.md has new entries for the bulk error messages and the startup lines.
  • docs/manuals/07-upgrade-manual.md lists migration 13 and covers backup and restore during a bulk operation. The guides that print the catalog migration show migration 13.
  • CONTRIBUTING.md moves its worked example to migration 14, because bulk_operations holds 13.
  • README.md lists the four operations, and extenddb.sample.toml has the [bulk] examples and the bulk limits. The design documents cover the bulk catalog tables, a batch's index checks and the bulk metrics.
  • REQ-DEPLOY-006 in docs/design/01-requirements.md raises the container image limit from 50 MB to 60 MB.

Decisions to review

  • The usage guide documents the S3 store and the filesystem store in one chapter, and says where the two behave differently.
  • The upgrade manual tells operators to cancel the bulk operations, or let them finish, before a backup that they intend to restore from. The catalog and the data database keep one operation's state as a matched pair, and a restore must bring both back to the same point.

Differences from DynamoDB

This commit adds no difference. The differences page lists the differences that the other commits add.

Differences from DynamoDB

docs/differences-from-dynamodb.md carries this list in its Bulk Operations table.

  • Input and report location: DynamoDB reads and writes S3 buckets as the caller. ExtendDB uses the store that [bulk] store selects. The S3 store reads and writes AWS S3 or an S3-compatible service with the server's own AWS credentials. The filesystem store maps S3Bucket to a directory in the caller's account subtree beneath one root. On both stores the report records and the manifest keep the arn:aws:s3::: spelling in inputSourceArn.
  • An output location that cannot be used: neither checks it at Start. At the first report record, both hold a missing bucket, an owner mismatch or a refused s3:PutObject and write every good row. Then both end FAILED with no report and no manifest (measured). DynamoDB also writes report objects during the run, and a write that fails there stops the operation at once (measured). ExtendDB writes its reports only when the operation ends, so it can write more rows than DynamoDB before it fails. DynamoDB's answers for two cases here are not measured. They are a refused s3:PutObject at the manifest write and the count of rows whose condition failed under a held fault.
  • S3BucketOwner: DynamoDB fails an owner other than the bucket's with S3AccessDenied, Access Denied (measured). The filesystem store fails any account other than the caller's in the same way, because the caller's account owns every bucket directory there. The S3 store sends an owner other than the caller's ExtendDB account id to S3 as x-amz-expected-bucket-owner, and S3 decides.
  • The caller's S3 permissions: DynamoDB performs s3:ListBucket, s3:GetObject and s3:PutObject as the caller, so identity, bucket and KMS key policies apply (measured). ExtendDB evaluates the three actions against the caller's ExtendDB identity policies. It has no bucket policies and evaluates no kms: action. Its denial carries no request-id tail, because no request reached S3. On the S3 store, S3 then evaluates the server's own request, and a denial that S3 returns names the principal that the server signs as.
  • The FailureMessage of an S3 fault: the S3 store adds the two tails that DynamoDB adds (measured), with S3's request ids. (Service: Amazon S3; Status Code: ...; Proxy: null) follows a fault of the listing, the input reads or the manifest. (Service: S3, Status Code: ...) (SDK Attempt Count: 1) follows a fault of a report write. The filesystem store gives the message without a tail.
  • A second start on a table with a running operation: DynamoDB rejects it with ResourceInUseException or accepts it and fails it later with that FailureCode. ExtendDB always rejects it at once.
  • TotalInputBytes and ProcessedInputBytes on a running operation: DynamoDB shows them 51.8 to 72.9 s after Start on a small input (measured). ExtendDB shows them once the first claim lists the input. ProcessedInputBytes then advances at each checkpoint.
  • MaxWriteRequestUnits and PerformanceTier: ExtendDB paces an operation's writes at MaxWriteRequestUnits 1 KB write units a second, under the server's bulk_put_write_units_per_second. It checks, stores and returns PerformanceTier, which does not change the rate. ExtendDB refuses ACCELERATED on a table with a vector index, as DynamoDB does.
  • InputFormat ION: DynamoDB accepts it and stores string, decimal, bool, blob, list and struct values and an untyped null, with annotations that make sets (measured). Any other Ion type, such as int, stops the file. ExtendDB refuses ION with a ValidationException that names the value. Bulk put: read Ion input in StartBulkPutItems #1387 tracks an Ion reader with these measurements.
  • S3SseAlgorithm and S3SseKmsKeyId: the S3 store applies them to every report object and the manifest. The filesystem store stores and echoes them, and they have no effect on its files.
  • AWS KMS keys on the input objects, the report objects and the table: on the S3 store, S3 uses the server's KMS permissions. ExtendDB evaluates no kms: action for the caller. An input object under a key that the server may not use fails with S3AccessDenied, and one under a disabled key with KmsDisabledException. A disabled or asymmetric report key fails the operation on its first claim with KmsDisabledException or KmsInvalidKeyUsageException. A KMS fault's FailureMessage carries S3's text, where DynamoDB's carries the text of its own KMS call. The filesystem store has no KMS. On both stores ExtendDB records the table's encryption settings only, so no table key fault refuses Start. DynamoDB refuses Start on a table whose key is disabled or pending deletion.
  • Report files for each kind: DynamoDB writes numbered files in one partition directory for each partition of the input. It writes the files of a partition when it finishes reading that partition, while the operation is IN_PROGRESS. It rolls a file once its compressed bytes pass 200 MiB. ExtendDB writes one partition directory after it reads the last row. It rolls at the same 200 MiB and applies its record and byte caps to the whole report. It drops the records past a cap and counts them in DroppedReportRecordCount on Describe and in the BulkReportRecordsDropped metric. DynamoDB documents no cap and returns no such member.
  • Report objects left incomplete: on the S3 store each report object is a multipart upload until its write completes at the end of the operation. A server that stops during those writes, or an abort that fails, leaves an incomplete upload in the output bucket. The upload stays until a lifecycle rule aborts it.
  • The order of the input objects: in two measured runs DynamoDB read the second object, by key order, in full before it finished the first. ExtendDB reads one object at a time in the byte order of the keys. As a result, a row in a later object overwrites a row with the same key in an earlier one.
  • Operation limits: ExtendDB has [limits] keys, such as max_bulk_input_bytes, max_bulk_input_files and max_bulk_item_count, where DynamoDB has service quotas. max_concurrent_bulk_operations sets one limit for both tiers. The input quotas start at DynamoDB's, and each ends the operation with DynamoDB's failure code. The SizeLimitExceeded message is ExtendDB's own, because DynamoDB's text is not measured.
  • ClientToken length: both allow 1,024 characters. DynamoDB answers HTTP 500 to a token of 1,972 UTF-8 bytes or more within that limit (measured). ExtendDB accepts it.
  • Operation record retention: bulk_operation_retention_days defaults to 30. A purged operation answers ResourceNotFoundException, and its report files stay.
  • The MongoDB and Cassandra backends: the four operations answer ValidationException, Bulk operations are not supported on this storage backend.
  • U+0000 in an attribute name, a string value or a key value: DynamoDB stores it, and so does SQLite. On PostgreSQL the row fails with an item-level record and the load continues, because jsonb cannot store the character. fix(storage): store U+0000 in strings on PostgreSQL and MongoDB #368 makes PostgreSQL store U+0000 in strings. The second of feat: add StartBulkPutItems and the bulk operation APIs #874 and fix(storage): store U+0000 in strings on PostgreSQL and MongoDB #368 to merge returns true from PostgreSQL's stores_nul_in_strings and drops the row failure. SQLite and PostgreSQL store binary values with zero bytes.
  • The manifest entry of the file the runner reads when a DeleteTable deletes the table during the operation: DynamoDB reports NOT_AVAILABLE. ExtendDB reports PARTIALLY_PROCESSED with the range of rows that it counted.

Follow-ups

  1. The S3 store has its own client crate, crates/s3. Moving it onto crates/backup-store waits until the backup stack on the merged feat(backup): catalog index, BackupCatalog, JobClaim, legacy reader [backup/restore 6] #671 is complete. feat(backup): [backup.store], the store identity file, backup purge [backup/restore 7] #672, feat(backup): CreateBackup job, worker and reconciler duties [backup/restore 8] #700 and feat(backup): RestoreTableFromBackup job and cross-backend matrix [backup/restore 9] #740 are in main.
  2. bulk_operations.input_files always holds [], because the input files are rows of bulk_operation_input_files. Migration 13 is not released, so the column can leave its CREATE TABLE before a release freezes the migration.
  3. The record text for a row whose attribute name is over 65,535 bytes follows the text of PutItem. The service's text for that row is not measured.
  4. Bulk put: read Ion input in StartBulkPutItems #1387: read Ion input. DynamoDB accepts InputFormat: ION and loads string, decimal, bool, blob, list, struct, null and the three annotated set types (measured 2026-11-19). ExtendDB refuses ION at Start until the reader lands.
  5. CI: add the macos job to the test gate after its first green run on main #1388: add the macos job of test.yml to the test gate after its first green run on main. The gate does not wait for it today, because the job has not run on main yet.
  6. fix(storage): store U+0000 in strings on PostgreSQL and MongoDB #368 stores U+0000 in strings on PostgreSQL. The second of feat: add StartBulkPutItems and the bulk operation APIs #874 and fix(storage): store U+0000 in strings on PostgreSQL and MongoDB #368 to merge returns true from PostgreSQL's stores_nul_in_strings, which drops the row failure that the differences list describes.

Testing done

The Rust suites:

  • crates/core: wire names, enum sets, ARN layers and description shapes.
  • crates/s3: the clients over the SDK's replay HTTP client. The tests cover endpoints, region redirects, retries and deadlines, the identity check and its log lines, and the temporary-keys warning.
  • crates/config: [bulk] sections, refused credential keys, the rule for plain http endpoints and environment overrides.
  • crates/storage: the bulk operation store contract suite, with the same cases on SQLite and on PostgreSQL. It covers start and idempotency, the table guard and caps, claims and leases, checkpoints and report pages. The other cases cover finish, purge, the ledger, the write owner, index creation during a run, lock waits and operations with many input files.
  • crates/engine: the handlers through dispatch, and the runner end to end on SQLite and, with EXTENDDB_TEST_PG_CONNECTION_STRING set, on PostgreSQL. The runner tests cover crash and resume, lease takeover, the ledger, row and file faults, cancellation, reports, the manifest and pacing. The S3 store tests use the SDK's replay HTTP client and a local stub listener. The bulk store contract suite runs each case on the filesystem store and, with EXTENDDB_TEST_S3_ENDPOINT set, on the S3 store.
  • crates/server: authorization of the five DynamoDB actions and the three S3 actions with their condition keys and policy variables, cross-account cases, and [bulk] resolution at startup.

The Python suite in tests/bulk_put runs against a server on either store, through devtools/run-tests --extenddb --pytest --bulk-store filesystem or --bulk-store s3, with EXTENDDB_TEST_BACKUP_STORE set as devtools/run-tests requires since #700. The S3 job runs devtools/run-tests --extenddb --pytest --bulk-store s3 --parallel --filter bulk_put against an S3-compatible service.

The behaviours that the docs mark as measured match recorded requests to DynamoDB and their responses. The measurements cover these areas:

  • request checks, their order and their error texts, ARN layers, and the Describe and List shapes
  • row faults that fail a row, and those that abandon the rest of a file, with their texts
  • bounds on the expression maps
  • report keys, record shapes, the roll at 200 MiB and the manifest
  • usage charges on tables with and without indexes
  • terminal statuses for missing buckets, owner mismatches, quota failures, cancels and deleted tables
  • UpdateTable during a run, and a stream enabled during a load
  • ClientToken replay, and AWS KMS keys on the inputs, the reports and the table

The S3 store follows these behaviours of AWS S3, each measured:

  • S3 keeps keys with // and ./ segments as written.
  • S3 puts the requested encryption on report objects and on the manifest.
  • S3 refuses a request whose expected bucket owner, from S3BucketOwner, does not own the bucket.
  • S3 redirects a request for a bucket in another region, and the store follows the redirect to the bucket.
  • S3 answers 412 to a GET whose If-Match no longer matches.

Measurements of AWS STS gave the error codes that the identity check reads. The cases were an unknown key, a wrong secret, an expired session token and a clock more than 15 minutes off.

Runs on the merge of main at d35d8601a:

  • cargo test --workspace --exclude extenddb-backup-store in the CI job for Rust 1.88: 4,880 passed, 0 failed, 71 ignored.
  • cargo test -p extenddb-storage-postgres --tests in CI: 505 passed, 2 ignored.
  • Against local database servers: cargo test -p extenddb-engine --lib with its PostgreSQL cases passed 1,255 tests, and the MongoDB and Cassandra migration tests passed.
  • cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings and cargo +1.88.0 check --workspace --all-targets are clean, and the license notices are current.
  • A fresh install's schema dump on PostgreSQL and on SQLite equals docs/schema.

Runs on e78692f73, after the merge of main at 4c4c533c9:

  • CI: 66 of 67 checks passed. The CodeQL check reports three alerts that are open on main as well.
  • run-tests passed on stable in 10 min 1 s and on Rust 1.91.1 in 8 min 22 s. Each job compiled 151 crates. ci: raise the run-tests time limit from 15 to 20 minutes #895 raises the job's 15-minute limit to 25 minutes.
  • The 1,769 engine library tests took 111.5 s on stable and 88.1 s on 1.91.1.

On 7526710ce, after the merge of main at 95425f5e8, the engine library tests took 110.9 s on stable and 123.6 s on Rust 1.88.0. On 5a12f1574 they took 310.1 s and 250.1 s. The 1.88.0 job of 7526710ce took 14 min 57 s, 3 s under its 15-minute limit. It spent 7 min 58 s of that time compiling 554 crates.

Runs on 288105959, after the merge of main at 8c643330c:

  • CodeQL: at 27bcbbcb4 the check reported 7 alerts, all 7 open on main under the same alert numbers (five rust/unsafe-deserialization, two rust/cleartext-logging). This branch introduces none.
  • cargo test -p extenddb-engine --lib on SQLite: 1,770 passed, 0 failed, in 119 s with Rust 1.97.0.
  • With EXTENDDB_TEST_PG_CONNECTION_STRING set against a pgvector/pgvector:pg16 container, the 15 _on_postgres cases of bulk_put::: 15 passed in 35 s.
  • tests/bulk_put against a SQLite server with a filesystem store built from this head: 54 passed, 4 skipped (three S3 store cases and the developer mode case).
  • cargo fmt --all --check, cargo clippy -p extenddb-engine --all-targets -- -D warnings with and without extenddb-engine/backup-test-hooks, and cargo +1.91.1 check -p extenddb-engine --all-targets are clean.

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: none for bulk put items. Migration 13 follows docs/adr/0023-catalog-migrations.md.

Breaking changes

  • A catalog without migration 13 needs extenddb migrate --yes before a server of this build starts on it, because the server refuses a catalog with pending migrations.
  • PutItem runs the nesting-depth check of the expression values before the table lookup. Only a request that combines an over-deep expression value with a missing table or an invalid item gets a different error.
  • The Rust API inside the workspace: DataEngine::put_items_batch is a required method, StorageEngine requires BulkOperationStore, and extenddb_core::validation::validate_put_item is gone.

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.

The new types are the requests and responses of StartBulkPutItems,
DescribeBulkOperation, ListBulkOperations and CancelBulkOperation, with
the member names of the API model. The arn module parses a bulk
operation ARN and answers a TableName written as a table ARN. One parser
serves the server's authorization layer and the engine's handlers, so
the two read each ARN the same way. LimitsConfig gains the bulk limits,
each with a serde default. They cap what one account and one operation
may use, such as concurrent operations, input bytes, rows read and
report records. Others set the retention period, the worker slots, the
runner's lease, the batch sizes and the write rate. MetricName gains
BulkOperationsStarted, BulkOperationsFinished and BulkPutItemsWritten,
and QuerySource gains BulkClaim and BulkRetention for the two bulk
workers.
The extenddb-s3 crate opens one store's S3 clients from its region,
endpoint_url and force_path_style settings. The clients sign with the
standard AWS credential chain, which the crate resolves once at startup,
logging the outcome under the store's name. They follow the region
redirects that AWS S3 sends, and they retry transient failures within
one time bound. Without an endpoint_url, the crate also sends one STS
GetCallerIdentity request at startup and logs the identity the
credentials sign as. The config crate reads [bulk], whose store key
selects the filesystem store or the S3 store. It refuses credential keys
in [bulk.s3], and a plain http endpoint_url off loopback unless the
section sets allow_insecure_endpoint. The settings display lists the
bulk store's settings and the bulk limits. The workspace manifest adds
the crate and the credentials-login feature of aws-config, so that the
credential chain resolves a profile written by aws login. It also
enables serde_json's unbounded_depth feature for the engine's row
parser, and Cargo.lock and the license notices change with the
manifest.
Migration 8 adds the bulk put items tables on SQLite and PostgreSQL:
operations, input files, report records, row outcomes and write owners.
The BulkOperationStore trait declares the storage steps of an
operation's lifecycle, which the engine calls: start, cancel, claim,
checkpoint, finish and the retention purge. DataEngine gains
put_items_batch, which writes rows and records their outcomes in one
transaction, so a resumed run writes no row twice. DataEngine::put_item
takes an optional row marker, and a put that carries one records its
outcome in the ledger. The engine's put path moves to
put_item/payload.rs, which the bulk runner shares, and core's
validate_put_item moves into it. PutItem now checks the nesting depth of
ExpressionAttributeValues with its condition checks, before the table
lookup. MongoDB and Cassandra have no bulk operation store: a bulk
request that reaches the store gets ValidationException, and migration
8 does not apply to them. The contract suite runs one set of store
cases on both SQLite and PostgreSQL, and docs/schema holds the new
dumps. The engine's manifest is in this commit because the put helper's
tests need the SQLite engine as a dev-dependency.
The engine dispatches StartBulkPutItems, DescribeBulkOperation,
ListBulkOperations and CancelBulkOperation. Start checks the request in
a fixed order, lists the input objects and records the operation. A
replay with the same ClientToken and parameters returns that operation,
and one with other parameters gets IdempotentParameterMismatchException.
A worker claims runnable operations and applies each input row with
PutItem's validation and condition handling, checkpointing after every
batch. A stopped run resumes without writing a row twice. When the
server stops its workers, a run still going after one second is
aborted, and a later claim resumes it. The input and the gzip error
reports go through the [bulk] store. The server evaluates each
operation's S3 actions as its caller. UpdateTable refuses a new index
while an operation on the table runs. A daemonized serve keeps the
directory it started in, so a relative path in its configuration
resolves as it does in the foreground. The server builds the engine's
OperationContext, which gains the bulk store, the caller and the
metrics, so both crates change in one commit.
tests/bulk_put sends the four bulk operations to a running server.
It covers validation, the lifecycle, idempotency, listing, the store
rules, authorization and the S3 permissions an operation checks for its
caller. The suite writes its inputs to and reads its reports from the
store that EXTENDDB_TEST_BULK_STORE names, and devtools/run-tests sets
it from its new --bulk-store option. On MongoDB and Cassandra the suite
checks that the server refuses the bulk requests, then skips. The new
integration-s3.yml workflow starts an S3-compatible service in a
container and runs the engine's store contract tests, then the suite,
against it. integration.yml calls it as a job, and the integration gate
requires that job to pass. The provisioned test user
may call s3:ListBucket, s3:GetObject and s3:PutObject. A CLI lifecycle
test checks that a daemonized serve resolves relative bulk, import and
export paths against its start directory.
The usage guide gains a Bulk Put Items chapter covering the request, the
input on each store, the four operations, the error report and
idempotency. The admin guide documents the [bulk] section, the S3
store's credentials, its rule for plain http endpoints and the bulk
limits. The security model lists the S3 actions an operation checks for
its caller. The differences page and the troubleshooting guide gain
bulk sections. The upgrade manual covers backup and restore during a
bulk operation. Its behaviour changes gain two entries. A daemonized
serve keeps the directory it started in, and PutItem checks the nesting
depth of ExpressionAttributeValues before the table lookup. The guides
that print the catalog migration show migration 8. The CONTRIBUTING
worked example moves to migration 9. The backup design reserves
PostgreSQL migration 9 for restore_progress, because stream_pending and
bulk_operations hold 7 and 8. REQ-DEPLOY-006 in
the requirements document raises the container image limit from 50 MB
to 60 MB. The README lists the four operations, and the sample
configuration has the [bulk] sections and the bulk limits. The design
guide lists the bulk catalog tables, and the storage and server design
documents cover a batch's index checks and the bulk metrics.
Main merged #672, #466, #875, #847 and #700. Bulk put items stays
catalog migration 8, because main added no migration.

Conflicts:
- Cargo manifests: the engine keeps its bulk dependencies and one tokio
  test-util entry for both uses. The server's tests take the in-memory
  SQLite catalog, the storage test-util feature, sqlx, tempfile and tokio.
  The SQLite crate's tests take tokio and main's engine and backup store.
  The storage test-util comment names both its uses.
- Metrics: the bulk names and the backup job names, and the bulk worker
  sources beside the backup job source.
- The server module list takes backup_store beside the bulk modules.
- The admin guide keeps main's health check lines before the Bulk
  Operations chapter.
- The backup design takes main's line on restore_progress. That
  migration number belongs to the restore job pull request.
- The generators rebuilt the four license notices from the merged lock.

Git put main's tokio-util entry under extenddb-s3 in the lock. Cargo
moved it to extenddb-engine, the crate that declares it. No package
version changed.

Main's BackupCatalog has seven new methods, and check_maintenance_claim
takes the stale bound. The two bulk test doubles pass each one, and
sweep_restore_registrations, to their inner engine. Main's two new
OperationContext initializers in the SQLite tests set the bulk fields
and the metrics collector.
Since #700, devtools/run-tests --extenddb --pytest exits 1 unless
EXTENDDB_TEST_BACKUP_STORE names the server's backup store. The S3 bulk
suite job starts a PostgreSQL server without a [backup.store] section,
so it sets the variable to none. The suite runs only the bulk_put tests,
and none of them is a backup test.
The Row errors section gave the type-tag message for every parse-level
cause other than a missing or non-object Item. That matched the first
measurements of the service. The rows module writes the texts of later
measurements. They are Unexpected token for text that is not JSON, and
eight other messages for causes the section did not name. The section now
has one table that pairs each cause with the message the rows module
writes. The item-level list adds the repeated attribute name, the nesting
bound, the condition size bound and the empty expression maps. It also
states that an ExpressionAttributeValues entry that does not decode fails
the row alone.
Main merged #868, whose new Cassandra GSI test calls DataEngine::put_item.
On this branch that method takes a trailing row marker, so the call
passes None. The merge has no textual conflicts.

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

Service measurements below: DynamoDB in us-east-1 on 2026-11-07, each request shape sent at least twice.

Reviewed at bd5e28b. The list below is the complete set of required fixes. Once these are done, I expect this to merge.

The branch conflicts with main. Since #740, main registers migration 8 as restore_progress (crates/storage/src/migrations/registry.rs:88). Bulk operations need migration 9, and the schema dumps and the guides that print the migration list move with it. This comes from main moving, not from the change.

Required

  1. A runner that lost its lease can still commit. The cancel drain on a server with no bulk store (worker/claim.rs:255) and the store-mismatch path (runner/mod.rs:254) end the operation without bulk_write_takeover. The old claim stays the write owner, so its in-flight batch passes the fence and writes items after the operation is CANCELLED or FAILED.
  2. The pacer wait is outside the lease. runner/write.rs:75 waits on the pacers after the lease check and without renewal. With 400 KB items and bulk_put_write_units_per_second at 166 or less, one batch waits at least 59 s against a 60 s lease. With two servers on one catalog, the claim moves between them with the checkpoint unchanged, and after ten such claims the operation ends FAILED.
  3. Concurrency limit. DynamoDB allows 5 non-terminal operations per account for each PerformanceTier, counted separately. The 6th start in one tier answers LimitExceededException "...for the selected PerformanceTier, which is 5.", and a start in the other tier is still accepted. ExtendDB counts both tiers together against 50 (limits/mod.rs:273, the count in storage-sqlite/src/bulk_operation_store/start.rs:241 and the PostgreSQL counterpart).
  4. Start for a bad input location. DynamoDB answers Start with HTTP 200 and IN_PROGRESS for a missing input bucket, then the operation moves to FAILED with S3NoSuchBucket. ExtendDB inserts the row already FAILED (handlers/start.rs:378, start_terminal_born). Past 100 such starts in an hour it answers ThrottlingException, which the service did not send.
  5. Start response members. DynamoDB's Start response and the first 40 to 80 s of Describe have no TotalInputBytes, ProcessedInputBytes or BulkOperationUsage. ExtendDB lists the whole prefix inside Start and returns TotalInputBytes (handlers/start.rs:453). The listing inside Start also refuses input over 10 GiB with ValidationException "Input exceeds max_bulk_input_bytes" (handlers/start.rs:436). The documented quota is 100 GB for STANDARD and 1 TB for ACCELERATED, and the documented failure is the operation ending with SizeLimitExceeded. Moving the listing after Start answers fixes 4 and 5 together.
  6. Output encryption validation. DynamoDB refuses at Start, with ValidationException, KMS with no key id, AES256 with a key id, and a key id with no algorithm. ExtendDB accepts all three (store.rs:202).
  7. ION input. DynamoDB accepts InputFormat: ION and stores string, decimal, bool, blob, annotated sets, list, struct and null values. An Ion int stops the file with "Unsupported Ion type". ExtendDB refuses ION at Start (handlers/start.rs:167).
  8. ClientToken bounds. DynamoDB accepts tokens of 1,025 bytes and a token containing U+0000. ExtendDB refuses tokens over 1,024 bytes with "ClientToken exceeds max_bulk_client_token_bytes" (handlers/start.rs:115). A 2,000-byte token gets HTTP 500 InternalFailure from the service, so the upper boundary still needs a measurement.
  9. U+0000 in items. DynamoDB stored a string value, an attribute name and a key value containing U+0000. ExtendDB fails the row on every backend, including SQLite.
  10. Error reports during the run. DynamoDB writes .../output/errors/output-00000.json.gz 11 to 22 s before the operation ends, and writes the manifest at the end. ExtendDB writes report objects only at the end. Past max_bulk_report_records (1,000,000) or max_bulk_report_bytes (1 GiB), records are dropped with nothing in the response or the report to show it, and a client has no counter that reveals the loss.
  11. MaxWriteRequestUnits and indexes. The pacer charges only the base-table item (runner/write.rs:66). The documentation counts index writes against the cap. Usage measured on a table with a GSI includes the GSI bytes in BulkOperationUsage.
  12. Filesystem store on case-insensitive disks. bulk_put::source::contract::filesystem::the_listing_is_in_byte_order_of_the_whole_key fails on macOS. There b.json and B.json are one file, while S3 keeps two objects. CI has no macOS job.
  13. Daemon working directory. A daemonized serve now keeps its start directory (cmd_serve.rs:257) where main changes to /. That changes how every relative path in an existing daemon deployment resolves, and it keeps the start directory busy. Please move this to its own PR or keep /.

Docs

  1. The differences page says DynamoDB reports NOT_AVAILABLE with no range for the file being read when a cancel arrives. The service reported PARTIALLY_PROCESSED [[0,N-1]] after a cancel at first progress (56,805 and 46,986 items written), NOT_PROCESSED for a cancel about 8 s in, and FULLY_PROCESSED once the read had finished. ExtendDB's PARTIALLY_PROCESSED matches, so the row in the differences table can go. NOT_AVAILABLE appeared when the table was deleted during the run.
  2. The differences page leaves out items 3 to 11.

Optional

  • DataEngine::put_item gains a marker path that no production caller uses (storage-sqlite/src/data/put_item.rs:28). It also skips fence_and_prune.
  • The BUILDS map in both index_guard.rs files never drops entries.
  • key_fault (put_item/payload.rs:75) classifies by message text, where ItemKeyFault exists for that purpose.
  • The two resume_bound tests still pass with the resume bound removed. store_outage::an_outage_that_outlasts_the_resume_bound_ends_the_operation_failed pins the bound.
  • An S3BucketOwner equal to the caller's account is dropped (store.rs:194). On a deployment whose account ids are AWS account ids, that value then sends no x-amz-expected-bucket-owner.

The new PutItem order for the nesting check matches the service. A PutItem to a missing table with an ExpressionAttributeValues value 32 levels deep answers ValidationException "Nesting Levels have exceeded supported limits...". At 31 levels it answers ResourceNotFoundException.

break;
};
if record.status == STATUS_CANCELLING
&& let Err(error) = finish_cancelled(storage.as_ref(), &claim_owner, &record).await

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.

This drain ends the operation without bulk_write_takeover, so the previous claim is still the write owner and its in-flight batch commits after CANCELLED.

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.

The drain now calls bulk_write_takeover before finish (4068582). A batch of the earlier claim then either committed before the takeover or writes nothing.

a_batch_in_flight_writes_nothing_after_the_no_store_cancel_drain holds that batch past its lease and releases it right after finish commits (72b6952), on SQLite and PostgreSQL. It wrote 5 items after CANCELLED before the change and none after it.

"bulk operation was not started on the configured store; it is failed unread"
);
st.failure = Some(Failure::internal());
return finalize(deps, &record, None, st).await;

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.

Same as the cancel drain: finalize here leaves the old claim as write owner.

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.

The store-mismatch branch now calls take_over before finalize (4068582), as every other path to finalize does.

rows.push(s.row);
metas.push((s.file_index, s.row_index, s.item_bytes, s.image));
}
deps.pacer.acquire(units).await;

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.

This wait is after the lease check and not covered by renewal. At 166 WCU/s or less with 400 KB items, one batch waits at least 59 s against a 60 s lease.

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.

The pacer wait now runs inside keeping_lease_in_place (8870e0d), and the runner checks the deadline again after the wait. The runner drops a batch whose lease ran out during the wait.

Each renewal writes back the progress the record already holds, so the cursor does not move past the staged rows. Two tests check this (6a5353a). The cursor is still 0 1.5 s into the wait, after at least three renewals. A crash during the wait loses no row.

} else {
// Step 3b: account concurrency limit, exact because the
// write lock and BEGIN IMMEDIATE serialize every start.
let non_terminal: i64 = sqlx::query_scalar(

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.

DynamoDB counts 5 per PerformanceTier, separately. Six STANDARD starts: the 6th answers LimitExceededException '...for the selected PerformanceTier, which is 5.'; an ACCELERATED start is still accepted. This count covers both tiers against 50.

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.

The start transaction now counts the request's tier only, on both stores (1c0a643). A row with no tier counts as STANDARD, and max_concurrent_bulk_operations is the limit in each tier, 5 by default. CANCELLING operations stay in the count: the service answered the same LimitExceededException to a Start sent while one of the five was CANCELLING, in four of five tries.

}
}
};
if let Some(fault) = initial_failure {

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.

DynamoDB answers this request with 200 and IN_PROGRESS, then the operation moves to FAILED S3NoSuchBucket (two runs).

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.

Start no longer reads the input location (1e5e9a5). It answers 200 IN_PROGRESS with no byte member. The first claim checks s3:ListBucket, the bucket and its owner, and the output KMS key before it reads a row. A missing input bucket then ends the operation FAILED with S3NoSuchBucket, no byte member, and no output object, which is the service's answer in three runs.

impl OutputSse {
/// The encryption the output configuration asks for. A key id is kept
/// only with `KMS`, the algorithm that uses one.
pub(crate) fn of(output: &OutputS3Configuration) -> Self {

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.

DynamoDB answers ValidationException at Start for KMS without a key id, AES256 with a key id, and a key id without an algorithm. All three pass here.

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.

Start now refuses all three pairs with ValidationException and the service's text for each (ae6d416): KMS with no S3SseKmsKeyId, AES256 with one, and S3SseKmsKeyId with no S3SseAlgorithm. A handler test and a wire case send the three pairs.

validate_configuration_characters(&stored_input_config, &stored_output_config)?;

// Step 3: modelled features this server does not implement.
if input.input_s3_configuration.input_format == BulkOperationInputFormat::Ion {

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.

DynamoDB accepts ION and loads Ion string, decimal, bool, blob, annotated sets, list, struct and null. An Ion int stops the file with 'Unsupported Ion type'.

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.

Start keeps refusing ION in this pull request, with InputFormat ION is not supported by this server. Reading Ion input needs an Ion text parser and a mapping from its types to DynamoDB types, which is a change of its own. Issue #1387 tracks it. It carries the measurements of 19 Nov. They cover the {Item:{...}} wrapper, the three set annotations and the typed nulls that stop a file, with the full Unsupported Ion type and null messages. The InputFormat: ION row of the differences page describes what the service loads and what stops a file.

// model constraint above. Their order among themselves is kept as it
// was, since it is unmeasured.
if let Some(token) = &input.client_token {
let cap = ctx.limits.max_bulk_client_token_bytes;

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.

DynamoDB accepts a 1,025-byte token and a token containing U+0000.

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.

Start now accepts a 1,025-byte token of 513 characters, because the length check counts characters (198ab27). Start also accepts a token with U+0000 inside, and the token replays on SQLite and PostgreSQL. On PostgreSQL the client_token column is now BYTEA and holds the token's UTF-8 bytes, because TEXT cannot store U+0000. The replay lookup still compares the SHA-256 hash of the token.

}
let mut rows = Vec::with_capacity(staged.len());
let mut metas = Vec::with_capacity(staged.len());
let mut units: u64 = 0;

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 documented cap counts index writes. This charges only the base item.

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.

The operation bucket now takes each row's units plus its projection units for every global and local secondary index, by PutItem's capacity rule (568c544). After the batch, WritePacer::settle sets the bucket from the item each write replaced, so a moved index key pays the old and the new projection.

Vector index writes do not count, because their charge is in vector bytes, which BulkPutBytes also leaves out. The usage guide and the differences page now describe this count (9d510a3).

Comment thread crates/app/src/cmd_serve.rs Outdated
std::env::current_dir().unwrap_or_else(|_| std::path::PathBuf::from("/"));
let daemon = Daemonize::new()
.pid_file(pid_file)
.working_directory(&start_dir);

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.

This changes the working directory for every daemon deployment, not only bulk ones.

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.

The daemon changes to / again, as on main (a24fb2a). The config loader makes a relative [bulk.filesystem] path and the dev-mode default absolute at load, before serve daemonizes, as it does for the backup store's path.

A lifecycle test starts the daemon from another directory with a relative bulk root and checks that the daemon's working directory is /. One StartBulkPutItems then loads a row from a file beneath the start directory.

crates/storage/src/migrations/registry.rs keeps the five migrations from main (8 restore_progress, 9 warm_throughput, 10 account_metrics, 11 attribute_name_escape, 12 unique_access_key_ids) and moves bulk_operations from this branch to 13. The RELEASED_THROUGH comment names 13.

The migrations/mod.rs files of crates/storage-postgres, crates/storage-sqlite, crates/storage-mongodb and crates/storage-cassandra retain the arms from main and append the BulkOperations arm of this branch after UniqueAccessKeyIds. The PostgreSQL runs_in list carries every id. The three bulk_operations SQL files move from 0008_ to 0013_, where the migration modules now read them.

crates/storage-mongodb/tests/migrations_fresh.rs, migrations_locks.rs and migrations_released.rs count 13 migrations. Migration 13 is not applicable on MongoDB, the ledger row of a later binary is 14, and a fresh store applies 14 steps.

CONTRIBUTING.md carries the migration example from main at the next free id, 14, and names bulk_operations among migrations 6 to 13.

Cargo.toml keeps the crates.io version pins from main and adds the extenddb-s3 pin from this branch. Both sides added aws-credential-types at the same version. One entry stays, with a comment that names both uses.

crates/engine/Cargo.toml, crates/server/Cargo.toml, crates/storage-sqlite/Cargo.toml and crates/storage-postgres/Cargo.toml keep the dev-dependencies from this branch in the path form from main, so cargo drops them from the published manifests. The engine keeps tempfile and the unix libc dev-dependency from main. crates/storage/Cargo.toml keeps both sides of the test-util feature comment.

Cargo.lock lists the engine's dependencies from both sides. cargo metadata --locked passes on the merged manifests.

crates/core/src/metrics/types.rs holds RestoreJob from main beside BulkClaim and BulkRetention from this branch.

crates/engine/src/batch_write_item.rs keeps the deferral loop from main and passes the None row marker from this branch to put_item.

crates/engine/src/lib.rs keeps item_authorizer from main and metrics from this branch on OperationContext. crates/server/src/handler.rs, crates/storage-sqlite/src/backup_catalog.rs and crates/storage-sqlite/tests/backup_job_panic.rs set both fields. In the handler, the start_caller call from this branch runs before the for_request call from main takes the identity.

crates/server/src/lib.rs and crates/storage-postgres/src/lib.rs declare the modules of both sides.

crates/app/src/cmd_serve.rs keeps the dev_mode_banner_lines function from main and gives it a bulk_store parameter, printed after the credentials line as this branch did. The banner computes that line from the dev-mode default path or from dev_mode_s3_line of this branch. The banner tests from main pass None for it.

crates/app/src/init_helpers.rs keeps the template tests from this branch and the write_owner_only doc comment from main.

devtools/run-tests keeps the shard command from main and the exit 5 handling of a filter that selects no CLI test from this branch.

docs/getting-started.md, docs/manuals/04-quickstart-setup-guide.md, docs/manuals/08-install-linux.md and docs/manuals/09-install-macos.md print sample output with the catalog at migration 13.

docs/manuals/07-upgrade-manual.md keeps the migration paragraphs from main and adds one for migration 13 from this branch. It lists 9 to 13 as breaking and keeps the v0.1.15 sections from both sides.

docs/manuals/05-admin-guide.md keeps the data recovery text from main and the paragraph on backups during a bulk operation from this branch. docs/manuals/10-security-model.md keeps the Resource line from main and the S3 actions on the Action line from this branch.

The four SOFTWARE-LICENSE-NOTICES files take the crate list from main. A later commit regenerates them against the merged Cargo.lock.
… main changed

Main and this branch each changed interfaces the other side's code calls, in files the merge joined without a conflict.

MetricsCollector::record takes the account on main (#955). The three bulk metrics pass the operation's account. The start handler reads it from the record, and record_finished_metrics takes it from the runner's record.

DataEngine::put_item takes the row marker on this branch. Nine test calls on main pass None. They sit in the SQLite stream lifecycle tests, in three PostgreSQL stream and catalog tests, and in four Cassandra direct tests. The Scripted double of the batch write tests and the Fake of the backup tests take the marker in put_item. Both get put_items_batch, bulk_row_outcome and delete_bulk_row_outcomes through their unused() helper.

OperationContext has item_authorizer from main and bulk, bulk_authorizer, bulk_principal and metrics from this branch. Five contexts on main set the four fields. They are the PartiQL test context and snapshot rebuild, the private modes test, the SQLite restore resume test and the PostgreSQL catalog NUL jobs test. The bulk handler and retention tests set item_authorizer.

BackupCatalog, LegacyBackupReader and StorageEngine grew on main (#740, #825, #880, #900). BulkUnsupportedStorage and FaultingStorage, the two delegating doubles of the bulk tests, pass the new BackupCatalog and LegacyBackupReader methods to their inner engine. remove_backup_row passes its four parameters. They implement RestoreEngine the same way.

check_user_authorization takes the action string on this branch. The Arn value test on main passes dynamodb:GetItem. AuthorizationStore::fetch_user_group_policies returns group and document pairs on main (#692). The two bulk authorization doubles return that type. The bulk authorization AppState sets request_timeout (#355) to the 30 second default.

The PutItem comment names validate_put_payload, which replaced validate_put_item on this branch. rustfmt formats the banner tests and the new test code.
… and tests

The merge moved bulk_operations from migration 8 to 13, because main holds migrations 8 to 12. The three SQL bodies, the PostgreSQL bulk operation store modules and the row outcome ledger module named 8 in their header comments. The PostgreSQL catalog migration test lists the migrations with a data database body: 1, 4, 7, 8, 11 and 13.
Main packages each workspace crate for crates.io (#927), and devtools/check-crate-packages checks the packages in the package job of the Test workflow. The extenddb-s3 crate on this branch had no description, repository or homepage, and its package held no LICENSE or NOTICE file.

The crate's manifest now has a description and takes repository and homepage from the workspace. LICENSE and NOTICE in crates/s3 link to the root files, in the same way as the other crates. The two commands of the package job, cargo package for the workspace and devtools/check-crate-packages, exit 0.
The merge took main's four SOFTWARE-LICENSE-NOTICES files, and the four checks of the notices-current job failed on them as stale. The files now come from devtools/generate-software-license-notices for the postgres, mongodb and cassandra backends and from devtools/generate-dev-license-notices, with cargo-about 0.9.0.

Each file adds extenddb-s3 0.1.14 to the users of the Apache License 2.0 text of the root LICENSE file. The other changed lines move license blocks to the positions cargo-about gives them. Main's files already listed the other crates the bulk put code depends on, so the regeneration adds or removes no other crate. The four checks exit 0.
Main checks table names and ARNs in table_name_gate before authorization (#830). Its default arm read the TableName of StartBulkPutItems with the ARN rules of the item operations. Two bulk authorization tests failed on the merged tree. Another account's index ARN got the Valid ARN format sentence instead of Invalid table ARN. An own ARN with the table segment a* got the pattern clause instead of the length clause.

The gate now leaves each StartBulkPutItems TableName that starts with arn: to the bulk checks. request_helpers/bulk.rs answers such a value with the bulk sentences before any lookup, and the bulk handler answers it in developer mode. The cross-account check skips the bulk operations for the same reason. A bare name still gets the gate's pattern check. For a name of up to 1024 characters, the bulk handler gives the same sentence.

Two rows in the table_name_gate tests cover the arm. A bare name with U+0000 gets the pattern sentence. An own table ARN with U+0000 in its name passes the gate. With the arm changed to pass every TableName, the first row fails. With the arm removed, the second row and the two bulk authorization tests fail. The server lib tests of bulk_authorization_tests, table_name_gate and arn_gate pass: 61 tests.
The merge joined the PR's section on a daemonized serve to the end of main's dynamodb:Attributes section. The heading of the PR's section came directly after the last paragraph of main's section, with no blank line. Every other heading in the upgrade manual has a blank line before it. This heading now has one too.
The two run-tests jobs of the Test workflow stopped at their 15-minute
limit on this branch after the merge of main. The engine lib tests took
310 s of the stable job. On 6 November, before the merge, the same job
took 13 min 57 s, and the engine lib tests took 301 s of it.

Each bulk put test harness bootstraps a SQLite catalog in developer mode.
The bootstrap hashes a generated admin password at bcrypt's default cost
of 12, and a debug build runs the hash without optimization. bcrypt's key
expansion runs in the blowfish crate.

The dev profile now builds blowfish with opt-level 3. The test profile
inherits from it, and release builds are unchanged. The cost and the
hashes stay the same.

Engine lib tests on the host, 4 test threads, 1769 passed in each run:
196.7 s before the change. With bcrypt and blowfish both at opt-level 3,
the run took 102.5 s. Four bulk put tests were run one at a time and
alternated 12 times. They took 5.07 s with blowfish alone at opt-level 3
and 5.43 s with both crates. The password tests of extenddb-storage pass
20 runs in a row, and the users test of extenddb-storage-sqlite passes.
Main at 4c4c533 (#857) updates aws-smithy-json to 0.62.7 and raises
the minimum Rust version to 1.91.1. Cargo.lock merged without a
conflict, and cargo metadata --locked accepts it.

SOFTWARE-LICENSE-NOTICES.html, SOFTWARE-LICENSE-NOTICES-MONGODB.html,
SOFTWARE-LICENSE-NOTICES-CASSANDRA.html and
SOFTWARE-LICENSE-NOTICES-DEV.html: regenerated with cargo-about 0.9.0
for the merged Cargo.lock. Against main, each file changes as this
branch changed it against 95425f5. The one exception is the
Apache-2.0 crate count, which main raised by two.
The usage guide said that a record of a kind not requested in OutputType
goes to the one kind that was requested. The runner writes such a record
to no report object, as the service does. The error-only row of the
order test shows it.

The differences row for the report files said that the service writes
one partition directory for each input hash partition. The row now says
that the service writes a partition's files when it finishes reading
that partition. It also says that ExtendDB writes its one directory
after the last row and counts the records it drops past its caps.
@LeeroyHannigan

Copy link
Copy Markdown
Collaborator Author

Item 10 and the optional DataEngine::put_item item are in:

  1. On the service (19 Nov), each report object of six operations appeared once, with one ETag, 2.6 to 48 s before EndTime. The manifest appeared at EndTime. The service writes the objects of an input partition (-0, -1, -2) after it reads that partition, and one 59 MB file or six small files gave -0 only. ExtendDB reads the whole input as -0. It writes each object once after the last row, then the manifest, then the terminal status, as a one-partition run on the service does. A runner test pins that order (99c791e). Records past max_bulk_report_records or max_bulk_report_bytes are now counted. Describe returns the count in DroppedReportRecordCount, and the BulkReportRecordsDropped metric records the total when the operation ends (d6baf88). The count is in the description because AWS SDKs skip a member that their model does not name. An extra report record or manifest line would break tools that parse those files.

The usage guide now says that a record of a kind not requested in OutputType goes to no report object, as on the service. The differences row for the report files says when each side writes them (0ae5c4f).

DataEngine::put_item takes main's six parameters again (e70d3af). No production caller passed a marker, and the bulk runner writes through put_items_batch, which checks the write owner. The calls that passed None take main's form, and 46 files now match main.

The differences row for the byte members said that `ProcessedInputBytes`
stays at 0 until the first object finishes. Each checkpoint records the
input bytes read so far, including those of the object that the runner
is reading, as two runner tests pin. The usage guide now says so too.

The ION row now says what the service does with ION input, as measured
on 19 Nov. The operation limits row now gives the input quotas. It also
says that the `SizeLimitExceeded` message is ExtendDB's own.
The admin guide, the `init` template and the sample config said that the
bulk keys are ExtendDB's own, with no DynamoDB equivalent. Five of them
default to DynamoDB's quotas: `max_concurrent_bulk_operations`,
`max_bulk_input_bytes`, `max_bulk_input_files`,
`max_bulk_input_object_bytes` and `max_bulk_client_token_chars`. The
three texts now say so.
The comment on the two table members of a description said "(326 of them
among them)". It now says that each of the 326 descriptions the service
answered during the measured runs carried the table only in
`TableDetails`.

Three other comments were out of date. `s3:ListBucket` runs on the first
claim, before the listing. Start refuses a `MaxWriteRequestUnits` below
1,024. The service refuses 1000 and 1023 with the model's range clause,
which has no `Invalid Request: ` prefix.
@LeeroyHannigan

Copy link
Copy Markdown
Collaborator Author

Item 15 is in. I checked each row of the Bulk Operations table against the code at this head. For items 3 to 11:

  • 3: the row "Concurrent operations per account" gives the count for each tier. The operator sets the limit, one value for both tiers.
  • 4 and 6: ExtendDB now answers as the service does, so neither needs a row.
  • 5: the row for the byte members said that ProcessedInputBytes stays at 0 until the first object finishes. Each checkpoint records the bytes read so far, and the row now says so (89af77b). The row "Operation limits" now gives the input quotas. It also says that the SizeLimitExceeded message is ExtendDB's own, because the service's text is not measured.
  • 7: the row "InputFormat: ION" now says what the service does with ION input, as measured on 19 Nov. ExtendDB still refuses ION.
  • 8: the row "ClientToken length".
  • 9: the row for U+0000, which differs on PostgreSQL only.
  • 10: the rows "Report files per kind" and "Output location that cannot be used".
  • 11: the row "MaxWriteRequestUnits, PerformanceTier". The server's own ceiling counts the table write only.

The usage guide now says that a checkpoint inside an object counts the bytes of that object read so far. a94d7a6 says in the admin guide, the init template and the sample config which bulk defaults are DynamoDB's quotas. 27bcbbc corrects four comments in the bulk code.

On 2026-11-23 the service answered StartBulkPutItems on a table that
does not exist with ResourceNotFoundException, "Requested resource not
found: Table: <name> not found". It gave that answer for every Invalid
Request shape sent, twice each. The shapes were a 1,025-character
ClientToken, no ClientToken, each of the three inconsistent output
encryption pairs, an empty OutputType and a one-character output
S3KeyPrefix. A model constraint (MaxWriteRequestUnits 1000) was still
answered first. ExtendDB ran the Invalid Request checks before the
table lookup and answered each of those shapes with its
ValidationException.

The Invalid Request checks now run after the table lookup, as step 6 of
the handler. They are the token checks, the empty OutputType, the
bucket checks, the prefix rules and the output encryption pair. The
model's constraints, this server's bounds on the stored configurations,
the ION refusal, the store check and the table lookup keep their order
before them. check_prefixes takes the store the store check found
instead of looking it up again.

Two orders among this server's own refusals change with the move: ION
and a missing store are now answered before a bad prefix. The two tests
that pinned the old order now pin the new one. The test that paired a
long token with a missing table is replaced by one table test. It sends
the seven measured shapes to a missing table and expects the not-found
text for each. The wire tests of the Invalid Request checks now run on
a table the fixture creates.
The bulk put runner cases that hold on both backends run their
PostgreSQL leg only when EXTENDDB_TEST_PG_CONNECTION_STRING is set.
They include takeover, pacing under the lease, the exactly-once resumes
and U+0000 rows. No job set the variable for the engine crate.
test.yml runs `cargo test
--workspace` without it, so each of the 15 `_on_postgres` tests printed
a skip and passed. CI never checked the PostgreSQL results that the
review replies cite.

run-postgres-storage-tests now runs `cargo test --release -p
extenddb-engine --lib bulk_put::` after the storage-level tests. The
step sets the connection string and EXTENDDB_TEST_PG_REQUIRED, which
turns the skip into a failure. The cases build and drop their own
databases on the job's server, one at a time. The job's timeout goes
from 40 to 60 minutes. The storage step alone took 22 min 37 s on the
20 Nov 2026 run at 27bcbbc. The new step builds the engine's release
test binary on top of it. CONTRIBUTING.md names the command beside the
storage one.

Locally, against a pgvector/pgvector:pg16 container, the 886 `bulk_put::`
tests pass with the 15 PostgreSQL cases run, in 105 s.
The SizeLimitExceeded and InputObjectTooLarge messages render the cap
in GB to one decimal, as the service spells its 5 GB per-object cap. An
operator can set max_bulk_input_bytes or max_bulk_input_object_bytes
far lower than the service's quotas. A cap of 53,687,091 bytes or less
then read "which is 0.0 GB.". A cap under 0.1 GiB is now rendered as
its byte count.

The listing quota test asserts the whole SizeLimitExceeded message for a
10-byte quota ("which is 10 bytes.") and for a 1 GiB quota ("which is
1.0 GB."), where it had checked one phrase of the message. The GiB case
lists one sparse file of 1 GiB plus one byte: the listing reads sizes,
not bytes, so the file costs no disk.
The doc comment of validate_configuration_size opened with "When
present, S3BucketOwner must equal the caller's account id." The check
measures the two serialized configurations and nothing else. Start
accepts an owner other than the caller's. The operation's first claim
decides it: S3AccessDenied on the filesystem store, S3's answer on the
S3 store. This commit removes the sentence and keeps the size rule.

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

Items 1 to 6, 8, 11 to 15 and the optional items from the earlier review are resolved at 2881059. Each request shape was sent at least twice to the service and to this head on SQLite, PostgreSQL and MongoDB, with the filesystem bulk store.

  • A claim that lost its lease no longer commits: the cancel drain and the store-mismatch path take over the write owner first, and each new test fails with its takeover removed.
  • At 150 units/s with a 60 s lease, 60 rows of 390 units complete in 155.6 s, from either server, on two release servers sharing one PostgreSQL catalog. e2654c4 ended that shape FAILED after 603 s. With one server killed during a pacer wait, the other claims after one lease and completes 60 of 60, with the same BulkPutBytes.
  • The sixth STANDARD start answers the service's LimitExceededException text, and ACCELERATED is still accepted. Of 12 parallel starts, 5 are accepted. A missing bucket, a wrong owner and an empty prefix answer 200 IN_PROGRESS and then FAILED with the service's code. The encryption pairs, the token rules (1,024 characters, 513 characters of 1,025 bytes, U+0000) and the 1,025-character refusal match the service.
  • 3,000 PutItem calls during a 40,000-row bulk load all return 200, with consistent table and GSI counts. Cassandra and MongoDB refuse every bulk call and write no rows.
  • 15 negative controls each fail their own test. CI passes 66 of 67 checks.

ION input blocks the merge. I will approve once it and the two items below are done.

crates/engine/src/bulk_put (InputFormat ION)

The service accepts InputFormat: ION (200). This head answers InputFormat ION is not supported by this server. #1387 records it, and the input format is part of this feature.

CodeQL

The CodeQL check is red. Its 7 alerts are open on main at the same paths, on lines this PR does not add. A dismissal with a comment would let the check go green.

Optional: confinement

The earlier review did not raise this. Nothing gates bulk put behind a Cargo feature, and 67 production files outside the bulk module change, among them the shared PutItem path, a rollback hook on every SQLite connection, a global logging filter and migration 13 on all four backends. With no [bulk] section, StartBulkPutItems answers ValidationException: Bulk operations are disabled, where main answers UnknownOperationException, and the bulk workers start. A module behind a feature, with main's answers when the feature is off, would let the feature be removed by deleting it.

// seconds later. CREATING and UPDATING were not
// measured that day: UPDATING is accepted and CREATING keeps the
// in-use answer below.
if table.table_status == TableStatus::Deleting {

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.

Since 6610468, a Start on a table in DELETING answers Invalid Request: Table not found before the Invalid Request checks at line 210. The service, and e2654c4, answer the specific text for an empty OutputType, a 1-character output prefix, a 2-character input bucket, the input bucket 10.20.30.40, an output with no S3Bucket, and KMS with no key id. Only a valid request gets Table not found.

LeeroyHannigan added a commit that referenced this pull request Nov 25, 2026
Run 43913418092 on #874 cut both run-tests legs at the 15-minute limit
on 16 Nov. Their workspace tests had run 14m00s and 14m38s by then, and
the backup store step after them takes 54 to 85 seconds. So the run
needed 15.0 to 16.1 minutes, and 20 minutes covers it with 3.9 to
spare. On main, the slowest run-tests job of the last 60 push runs took
12.2 minutes.

This corrects the messages of e37eac9 and 0bb5767, which give
run-tests 25 minutes. The other four limits in the message of
e37eac9 are main's now, as 0bb5767 says.
rlunar pushed a commit to rlunar/extenddb that referenced this pull request Nov 25, 2026
* ci: raise the time limits of five jobs that run near them

On main's last seven push runs, run-integration took up to 39.1
minutes, run-integration-sqlite up to 39.2 and mongodb-rust up to 38.7,
against a 40-minute limit. cassandra-pytest took up to 41.6 minutes
against 45. A run that restores no Rust cache builds for longer. The
bulk put items pull request (ExtendDB#874) had the three 40-minute jobs
cancelled at the limit. Every test that had run in them passed. These
jobs now stop at 60 minutes.

run-tests stops at 25 minutes instead of 15. On ExtendDB#874 it took 12 to 15
minutes. Its build took 5.5 minutes without a cache, where main's takes
2, and the engine's unit tests took 5 minutes on the 4-core runner.

A job that hangs now holds its runner up to 20 minutes longer.

* ci: set the run-tests time limit to 20 minutes

Run 43913418092 on ExtendDB#874 cut both run-tests legs at the 15-minute limit
on 16 Nov. Their workspace tests had run 14m00s and 14m38s by then, and
the backup store step after them takes 54 to 85 seconds. So the run
needed 15.0 to 16.1 minutes, and 20 minutes covers it with 3.9 to
spare. On main, the slowest run-tests job of the last 60 push runs took
12.2 minutes.

This corrects the messages of e37eac9 and 0bb5767, which give
run-tests 25 minutes. The other four limits in the message of
e37eac9 are main's now, as 0bb5767 says.

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.

2 participants