[Improvement] Support Idempotency-Key header in Iceberg REST server
- Dominant language
- Java
- Stars
- 3.2k
- Forks
- 935
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 298
Description
### What would you like to be improved?
The Gravitino Iceberg REST server does not recognize or handle the `Idempotency-Key` header on any mutation endpoint. The Iceberg REST spec defines this as an optional UUIDv7 header on all create, update, and delete operations. When present, the server should return the original response for replayed keys instead of re-executing the operation. The spec also defines an `idempotency-key-lifetime` field in the `/config` response to advertise support and the key reuse window. Currently there are zero references to `Idempotency-Key` anywhere in the Iceberg REST server codebase, meaning clients cannot safely retry failed mutation requests without risking duplicate side effects.
### How should we improve?
- Accept the `Idempotency-Key` header (UUIDv7) on all mutation endpoints in `IcebergTableOperations`, `IcebergNamespaceOperations`, and `IcebergViewOperations`
- Store completed responses keyed by the idempotency key with a configurable TTL
- Return the stored response on duplicate keys instead of re-executing the operation
- Advertise `idempotency-key-lifetime` (e.g., `PT30M`) in the `IcebergConfigOperations` config response
- Add unit tests for idempotent retry behavior
Contributor guide
Research direction
Start by reading IcebergTableOperations, IcebergNamespaceOperations, IcebergViewOperations, and IcebergConfigOperations to map mutation endpoints and the config response. Define the configurable response lifetime and review existing unit-test patterns before adding tests for replayed keys, TTL behavior, and the advertised idempotency-key-lifetime field.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100