Skip to content

Skip no-op delta rebuilds for root-local hash indexes#805

Open
tnabulsi-netflix wants to merge 1 commit intoNetflix:masterfrom
tnabulsi-netflix:codex/hashindex-skip-noop-delta
Open

Skip no-op delta rebuilds for root-local hash indexes#805
tnabulsi-netflix wants to merge 1 commit intoNetflix:masterfrom
tnabulsi-netflix:codex/hashindex-skip-noop-delta

Conversation

@tnabulsi-netflix
Copy link
Copy Markdown

@tnabulsi-netflix tnabulsi-netflix commented Mar 18, 2026

Summary

  • skip HollowHashIndex delta reindexing when the index is root-select and all match fields are direct non-reference fields on the root type
  • keep the existing rebuild-on-every-delta behavior for traversing or reference-based hash indexes
  • add regression tests covering skipped rebuilds, rebuilds on root changes, and unchanged behavior for non-root-local indexes

Testing

  • ./gradlew :hollow:test --tests com.netflix.hollow.core.index.HollowHashIndexTest --rerun-tasks -Pcom.netflix.gradle-predictive-test-selection.enabled=false

@tnabulsi-netflix tnabulsi-netflix changed the title Skip no-op delta rebuilds for root-local hash indexes Reduce HollowHashIndex delta rebuild work Mar 18, 2026
@tnabulsi-netflix tnabulsi-netflix force-pushed the codex/hashindex-skip-noop-delta branch from 3b230ac to 578f002 Compare March 18, 2026 23:05
@tnabulsi-netflix tnabulsi-netflix changed the title Reduce HollowHashIndex delta rebuild work Skip no-op delta rebuilds for root-local hash indexes Mar 18, 2026
this.hashStateVolatile = new HollowHashIndexState(builder);
}

private boolean canSkipNoOpDeltaUpdate() {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This part is not needed, as ordinal change is a direct signal on whether or not a hash needs to rebuilt.
One reason is that, for top level type A, if its member type B has a field change, the change would cause the type A record to have an ordinal change as well.
This statement holds true, also because:

  1. for a type, an ordinal will not be reassigned within a single cycle.
  2. Hollow Data set version update via delta would apply every delta on the version chain, and would not skip a version.
  3. a sub type's ordinal change would propagate all the way up to the top level type, all the record along the hierarchy would get assigned a new ordinal.

But also wonder if there are other edge cases..

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@azeng-netflix need to check if double snapshot scenario is also handled and add unit test that would check this invariant in the future.

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.

2 participants