Skip to content

Parallel integ check in producer cycle - #848

Open
spjegan wants to merge 2 commits into
Netflix:masterfrom
spjegan:feature/shardedIntegCheck
Open

spjegan wants to merge 2 commits into
Netflix:masterfrom
spjegan:feature/shardedIntegCheck

Conversation

@spjegan

@spjegan spjegan commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Integrity checks in the producer side are currently parallelized across types. This means, if a type has many shards, the integrity check happens sequentially for each shard. This PR changes that by parallelizing it "per type and per shard". This feature is an opt-in via the builder. Opting out retains the old functionality. The benefit we get by parallelizing by shard is applicable only when type-sharding is enabled.

@spjegan spjegan self-assigned this Aug 13, 2026
@spjegan
spjegan requested a lite review from Copilot August 13, 2026 16:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces opt-in per-shard parallelization for producer integrity checks (checksums) and snapshot serialization, aiming to improve performance for large multi-shard types while preserving the default (legacy) behavior when flags are unset.

Changes:

  • Add an opt-in per-(type, shard) parallel checksum computation and plumb it through producer checkIntegrity with a single per-cycle flag read.
  • Add opt-in per-shard snapshot computation hooks to write states and use them in HollowBlobWriter to parallelize snapshot calculation while keeping byte-identical output.
  • Add targeted sharding tests covering correctness, sensitivity, resharding cycles, and byte-identical snapshot output.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
hollow/src/main/java/com/netflix/hollow/tools/checksum/HollowChecksum.java Adds opt-in per-shard checksum mode and an explicit-flag overload to keep integrity checks consistent within a cycle.
hollow/src/main/java/com/netflix/hollow/api/producer/AbstractHollowProducer.java Reads checksum mode once per integrity check and applies it consistently to all four checksum computations.
hollow/src/main/java/com/netflix/hollow/core/read/engine/HollowTypeReadState.java Adds per-shard checksum API (getShardChecksum) and a new applyShardToChecksum hook.
hollow/src/main/java/com/netflix/hollow/core/read/engine/object/HollowObjectTypeReadState.java Implements per-shard checksum application for OBJECT read state.
hollow/src/main/java/com/netflix/hollow/core/read/engine/list/HollowListTypeReadState.java Implements per-shard checksum application for LIST read state.
hollow/src/main/java/com/netflix/hollow/core/read/engine/set/HollowSetTypeReadState.java Implements per-shard checksum application for SET read state.
hollow/src/main/java/com/netflix/hollow/core/read/engine/map/HollowMapTypeReadState.java Implements per-shard checksum application for MAP read state.
hollow/src/main/java/com/netflix/hollow/core/write/HollowTypeWriteState.java Adds extensibility points for per-shard snapshot computation (numSnapshotShards, prepareCalculateSnapshot, calculateSnapshotShard).
hollow/src/main/java/com/netflix/hollow/core/write/HollowObjectTypeWriteState.java Implements per-shard snapshot calculation for OBJECT write state.
hollow/src/main/java/com/netflix/hollow/core/write/HollowBlobWriter.java Adds opt-in per-shard fan-out during snapshot calculation while writing shards serially in-order for identical bytes.
hollow/src/test/java/com/netflix/hollow/tools/checksum/HollowChecksumShardedTest.java New tests validating per-shard checksum determinism, sensitivity, and resharding integrity behavior.
hollow/src/test/java/com/netflix/hollow/core/write/HollowObjectTypeWriteStateShardedTest.java New tests asserting per-shard snapshot computation is byte-identical to serial, including ordinal-hole scenarios.
hollow/src/test/java/com/netflix/hollow/core/write/HollowBlobWriterShardedTest.java New end-to-end tests asserting parallel snapshot blobs match serial bytes and round-trip correctly.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread hollow/src/main/java/com/netflix/hollow/core/read/engine/HollowTypeReadState.java Outdated
Comment thread hollow/src/main/java/com/netflix/hollow/api/producer/AbstractHollowProducer.java Outdated
Comment thread hollow/src/main/java/com/netflix/hollow/core/write/HollowBlobWriter.java Outdated
@spjegan
spjegan force-pushed the feature/shardedIntegCheck branch from a3ef96c to 1d264bf Compare September 3, 2026 05:53
@spjegan
spjegan marked this pull request as ready for review September 3, 2026 21:25

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.

3 participants