Skip to content

Bulk operations: GET_ALL + PUT_ALL with owner partitioning (Step 12) - #29

Open
rigazilla wants to merge 1 commit into
infinispan:mainfrom
rigazilla:bulk-ops-step12
Open

rigazilla wants to merge 1 commit into
infinispan:mainfrom
rigazilla:bulk-ops-step12

Conversation

@rigazilla

Copy link
Copy Markdown
Member

Closes #28. Roadmap Step 12 — multi-key bulk operations.

What

  • putAll(map<ByteArray,ByteArray>, lifespan, maxIdle) -> future<void> (0x2D/0x2E) — shared expiration, same encoding as put.
  • getAll(set<ByteArray>) -> future<map<ByteArray,ByteArray>> (0x2F/0x30) — keys absent from the cache are omitted.
  • Both exposed on RetryView for the excluding() retry path.

Owner partitioning (client-side scatter/gather)

Keys are grouped by primary owner and one sub-request is sent per owner concurrently, then merged — mirroring the Java client's HotRodBulkOperation.gatherOperations/reduce. groupKeysByConnection reuses the single-key router (selectServerForKey) per key, so HASH_DISTRIBUTION_AWARE yields one group per owner (inheriting exclusion / proxy / seed fallback) and BASIC / no-topology collapses to a single request.

Error handling (follows D2; differs from Java)

  • Before send: automatic failover — a key whose owner is unreachable re-routes to a backup / proxy.
  • After send: any sub-op failure fails the whole op (first error rethrown, triedNodes enriched across partitions, no partial results); retry is user-decided via excluding(e). Java auto-retries each partition up to maxRetries — we intentionally do not (docs/ERROR_HANDLING_DESIGN.md).

BULK_GET deferred

It is opcode 0x19→0x1A, not 0x1F (0x1F is QUERY — the old roadmap note was wrong), is absent from the modern Java client, and is under-specified in hotrod40.ksy (bulk_get_response.chunk has no key). GET_ALL covers "fetch many known keys"; BULK_GET needs the live wire format verified first.

Tests

  • Unit (BulkOpsTest) — wire-layout vectors for putAll/getAll.
  • Integration — BulkOpsIntegrationTests (single server: round-trip, missing-key omission, overwrite, empty set/map, non-default expiration, after-disconnect) + owner-partitioning and excluding() re-route cases in HashAwareRoutingIntegrationTests (3-node cluster).
  • Unit 284→294, integration 107→117 (24 suites), all passing.

Docs

STATUS, DECISIONS (incl. the superseding note that corrects an initial single-server-routing mistake), README, and the cache-operations guide updated in-commit.

🤖 Generated with Claude Code

infinispan#28)

Roadmap Step 12. Adds the multi-key bulk operations to RemoteCache:

- putAll(map<ByteArray,ByteArray>, lifespan, maxIdle) -> future<void>
  (0x2D/0x2E; shared expiration encoding identical to put()).
- getAll(set<ByteArray>) -> future<map<ByteArray,ByteArray>>
  (0x2F/0x30; keys absent from the cache are omitted).

Keys are partitioned by primary owner and one sub-request is sent per owner
concurrently, then merged — mirroring the Java client's HotRodBulkOperation
gatherOperations/reduce. groupKeysByConnection reuses the single-key router
(selectServerForKey) per key, so HASH mode yields one group per owner and
BASIC/no-topology collapses to a single request. Both ops are exposed on
RetryView for the excluding() retry path.

Error handling follows this client's D2 model (and diverges from Java): before
send, a key whose owner is unreachable re-routes to a backup/proxy; after send,
any sub-op failure fails the whole op (first error, triedNodes enriched across
partitions, no partial results) and retry is user-decided via excluding(e) —
Java instead auto-retries each partition up to maxRetries.

BULK_GET is deferred: it is opcode 0x19 (not 0x1F, which is QUERY — the old
roadmap note was wrong), is absent from the modern Java client, and is
under-specified in hotrod40.ksy, so it needs the live wire format verified first.

Tests: BulkOpsTest (unit wire-layout vectors); BulkOpsIntegrationTests (single
server) and owner-partitioning + excluding() cases in
HashAwareRoutingIntegrationTests (3-node cluster). Unit 284->294, integration
107->117 (24 suites). Docs: STATUS, DECISIONS, README, cache-operations guide.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

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.

Bulk operations: GET_ALL + PUT_ALL (Step 12)

1 participant