Repository navigation
Persistence: DynamoDB (atomic) table schema and test harness - #5830
Merged
Merged
Conversation
ZephyrYWZhou
force-pushed
the
dynamodb-atomic-schema
branch
from
October 21, 2026 05:49
b8bc1f9 to
bdc8fe5
Compare
ZephyrYWZhou
marked this pull request as ready for review
October 23, 2026 00:56
orca-review-bot
left a comment
There was a problem hiding this comment.
Note
AI-generated review. Written by an agent. It can be wrong, so please push back where it is.
Nice small step. Provisioning sits in the right place and stays off the request path. Main asks:
- The test harness hand-rolls a per-class Floci container.
FlociAwsExtension/@FlociAwsalready gives a shared container with startup retries. Can we use it, and move these Docker tests tointTestlike the other Floci tests? - Can we add negative tests for
verifyKeySchema: wrong PK/SK, and a missinggsi1? That's the only real logic in the PR. - The PR says the tests weren't run locally. Can you confirm they're green in CI?
No CHANGELOG or docs needed while the backend isn't selectable.
- Validate the active table's layout after the waiter so the create-race loser path is checked too, not only describeTable. - Verify the by-name GSI projection is ALL, not just its key schema, so a pre-existing KEYS_ONLY gsi1 is rejected instead of returning partial rows. - Move the Floci/Docker-backed tests to an intTest suite so :test needs no Docker daemon, matching the rest of the repo. - Use @ExtendWith(FlociAwsExtension.class) + @FlociAws to share one container JVM-wide with startup retries, instead of hand-rolling a per-class container. - Drop redundant testcontainers deps (exported transitively by polaris-floci-aws-testcontainer) and the unused apache-client test dep.
Contributor
Author
|
All AI reviewer comments addressed. Tagging @flyrain for the next round of review, appreciated! |
flyrain
previously approved these changes
Oct 26, 2026
flyrain
left a comment
Contributor
There was a problem hiding this comment.
LGTM. Thanks @ZephyrYWZhou !
flyrain
previously approved these changes
Oct 27, 2026
dimas-b
reviewed
Oct 27, 2026
dimas-b
left a comment
Contributor
There was a problem hiding this comment.
No opinion on DynamoDB schema design, but the PR looks good to me overall. Just one minor comment.
dimas-b
approved these changes
Oct 27, 2026
flyrain
approved these changes
Oct 27, 2026
6 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Next step of the optional DynamoDB persistence backend (#5615), building on the merged skeleton (#5622) and single-table data model (#5707). This PR adds table provisioning for the
dynamodb-atomicmodule and a test harness that runs against a real DynamoDB API, so later PRs (theBasePersistenceimplementation and its conformance tests) have something to run against.Still no persistence logic and no runtime wiring — provisioning is a control-plane step, not a request path.
Design
DynamoDbSchemacreates the single base table plus the by-name global secondary index, matching the keys defined inDynamoDbLayout:PK(HASH) /SK(RANGE), on-demand (PAY_PER_REQUEST) billing.gsi1) —GSI1_PK(HASH) /GSI1_SK(RANGE), projectionALL, used to list a parent's children.createIfAbsentis idempotent — an already-present table is validated against the expected base/GSI key schema (surfacing a misconfigured table) and otherwise left untouched — and blocks until the table is active;deleteIfExistsis the teardown counterpart for tests. This is the DynamoDB equivalent of a relational schema script — a bootstrap-time step, not something on the request path.The test harness (
AbstractDynamoDbTest) starts a sharedFlociAwsContainerand builds aDynamoDbClientagainst it — the same container the NoSQL DynamoDB module uses — with a uniquely named table per test for isolation.Changes
DynamoDbSchema—createIfAbsent/deleteIfExistsfor the base table + by-name GSI.AbstractDynamoDbTest— shared Floci-backed DynamoDB client base for container tests.DynamoDbSchemaTest— asserts the provisioned key schema / GSI / projection, idempotency, and a GSI round-trip: two siblings written viaEntityItem.toItemare queried back throughgsi1, exercising the data model and schema end-to-end against a real DynamoDB API.build.gradle.kts— add test-scope deps (polaris-floci-aws-testcontainer, testcontainers,awssdk:apache-client).Testing
./gradlew :polaris-persistence-dynamodb-atomic:spotlessCheck checkstyleMain checkstyleTest compileJava compileTestJavaand:polaris-bom:verifyBomDependenciespass. The threeDynamoDbSchemaTestcases run against the Floci container and require Docker; they were not run in my local environment (no Docker daemon) and are expected to run in CI.Scope / follow-ups
Provisioning + harness only. Next: the
BasePersistenceimplementation (entity writes, CAS, name-sentinel, lookups, listing) with a conformance test extendingBasePolarisMetaStoreManagerTeston this harness, then the factory / CDI / config wiring that makes the backend selectable.Checklist
CHANGELOG.md(if needed)site/content/in-dev/unreleased(if needed)