mirror of
https://github.com/floci-io/floci.git
synced 2026-11-22 21:50:46 -05:00
fix(dynamodb): reject ConsistentRead on GSI Scan (#2931)
Query already rejected ConsistentRead=true on a global secondary index, but Scan silently performed the read. AWS returns ValidationException 'Consistent reads are not supported on global secondary indexes' for both operations. Extract the check into rejectConsistentReadOnGsi and apply it to both handlers; strongly consistent reads on tables and LSIs stay legal. Reproduced with paritysuite/dynamodb-conformance (tests/tier3/error-messages/indexReads.test.ts): the Scan case failed against 2.0.1 and passes with this change; the in-repo DynamoDbAccessPathIntegrationTest gains a wire-level Scan case plus an LSI-acceptance guard, and the Java SDK compat twin covers both ops. Signed-off-by: Kévin Dehoux <dehoux.kevin@gmail.com>
This commit is contained in:
1 parent
fad54f3c7a
commit
6dec21479b
3 files changed
+38
-10
No files matched your search
+4
@@ -193,6 +193,10 @@ class DynamoDbAccessPathValidationTest {
|
||||
.keyConditionExpression("#status = :status")
|
||||
.expressionAttributeNames(Map.of("#status", "status"))
|
||||
.expressionAttributeValues(Map.of(":status", value("open")))));
|
||||
assertValidationException(() -> ddb.scan(request -> request
|
||||
.tableName(TABLE)
|
||||
.indexName("status-index")
|
||||
.consistentRead(true)));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in new issue
Block a user