UpdateItem: an empty secondary-index key sent through legacy AttributeUpdates gets the UpdateExpression wording on every backend
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
Read the four UpdateItem call sites in crates/storage-sqlite/src/data/update_item.rs, crates/storage-postgres/src/data/update_item.rs, crates/storage-cassandra/src/data/update_item.rs, and crates/storage-mongodb/src/data_engine.rs, plus the context definition in crates/core/src/validation/mod.rs. Check how maps.legacy_attribute_updates is set in crates/engine/src/update_item.rs, then add the string, binary, LSI, and absent-item cases to tests/test_index_key_validation_on_update.py. Done when those cases match the service across all four backends.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Observed
Found in the review of #416. When UpdateItem sets a secondary-index key to an empty string or binary through the legacy AttributeUpdates parameter, the service answers with the PutItem form of the message, which names the index and the key. ExtendDB answers with the UpdateExpression form, which names neither.
UpdateItem AttributeUpdates {"gs": {"Action": "PUT", "Value": {"S": ""}}} (gs is the key of gs-index)
service: 400 ValidationException | One or more parameter values are not valid. A value specified for a secondary index key is not supported. The AttributeValue for a key attribute cannot contain an empty string value. IndexName: gs-index, IndexKey: gs
ExtendDB: 400 ValidationException | One or more parameter values are not valid. The update expression attempted to update a secondary index key to a value that is not supported. The AttributeValue for a key attribute cannot contain an empty string value.
The same holds for a binary key (gb, gb-index), an LSI key (ls, ls-index), and for an item that does not exist yet. Type mismatches sent through AttributeUpdates already match the service, which uses the expression wording for those.
Measured on Cassandra against the service. SQLite, PostgreSQL and MongoDB pass the same context at their own call sites (below) and were not measured separately.
Reading of the code
The engine desugars AttributeUpdates into an UpdateExpression (crates/engine/src/update_item.rs, desugar_attribute_updates) and records the request form in ExpressionMaps::legacy_attribute_updates (line 150), which the item-size rule reads. The storage layers receive maps and pass SecondaryIndexEmptyContext::UpdateExpression unconditionally when they check the written index keys:
crates/storage-sqlite/src/data/update_item.rs:97crates/storage-postgres/src/data/update_item.rs:211crates/storage-cassandra/src/data/update_item.rs:174crates/storage-mongodb/src/data_engine.rs:1888
The Item variant already produces the service's PutItem wording (crates/core/src/validation/mod.rs:1491).
Fix direction
At the four sites, select SecondaryIndexEmptyContext::Item when maps.legacy_attribute_updates is set. Add the legacy cases (string, binary, LSI, absent item) to tests/test_index_key_validation_on_update.py and run them against the service and all four backends. Depends on #416 for the test file.
Reproduce
aws dynamodb update-item --endpoint-url https://127.0.0.1:8000 --table-name t \
--key '{"pk": {"S": "a"}}' \
--attribute-updates '{"gs": {"Action": "PUT", "Value": {"S": ""}}}'
- Ngôn ngữ chính
- Rust
- Star
- 517
- Fork
- 60
- Merge trung bình
- 2 ngày 23 giờ
- Pull request đã merge (30 ngày)
- 25
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của ExtendDB/extenddb
-
backend:mongodb bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 2 ngày
-
backend:cassandra bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 2 ngày
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 2 ngày
-
backend:cassandra bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 2 ngày
-
[storage.cassandra] accepts unknown keys silentlyCó thể đã có người làm @LeeroyHannigan đã nhận 2 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
ExtendDB/extenddb#540 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của ExtendDB/extenddb
Issue tương tự
-
component:benchmark
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
agentic-os-org/ANOLISA#9177 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
oracle/rust-oracledb#61 ·
-
bug priority-medium to-agent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Databricks tool-only response crashes in resolve_reasoning_and_content with KeyError: contentCó thể đã có người làm @1divyanshdev đã nhận hôm nay. Đang mởllm translation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
BerriAI/litellm#48637 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày