Repository navigation
GEODE-vector-pr2: Add Dual-Epoch Tier-0 Vector Delta Buffer and Distributed Hybrid k-NN Function - #8156
Draft
gouthamaenugu wants to merge 29 commits into
Draft
GEODE-vector-pr2: Add Dual-Epoch Tier-0 Vector Delta Buffer and Distributed Hybrid k-NN Function#8156gouthamaenugu wants to merge 29 commits into
gouthamaenugu wants to merge 29 commits into
Conversation
added 9 commits
November 21, 2026 04:01
…hybrid k-NN function - Add per-bucket lock-free dual-epoch (E_active, E_flushing) Tier0VectorDeltaBuffer with stamped epochs/sequences, writer quiescence on atomic flush swap, strict post-commit/maybeRefreshBlocking flush completion, tombstone/override masking, and cardinality/epoch metrics. - Add SIMD-friendly unrolled VectorSimilarityScorer matching Lucene 9.12.3 VectorSimilarityFunction score semantics (COSINE, DOT_PRODUCT, EUCLIDEAN, MAXIMUM_INNER_PRODUCT) and Tier0MetadataMatcher for unified filter predicates. - Add Tier0VectorRegistry and Tier0VectorBucketListener for synchronous bucket capture, rebalancing lifecycle, and commitAndRefreshBlocking flush coordination. - Add DistributedHybridKnnFunction and HybridKnnQueryContext executing per-primary-bucket pre-filtered KnnFloatVectorQuery unioned with Tier-0 under highest-epoch precedence and reduced via TopEntriesCollectorManager / TopEntriesFunctionCollector. - Add comprehensive unit tests and multi-bucket DUnit tests covering dual-epoch concurrency, zero visibility gap, 1%/5%/50% filtered selectivity, concurrent writes, and bucket rebalancing.
- PR2-B1: Wire Tier0VectorRegistry cleanup on index destroy (LuceneIndexImpl.destroy, LuceneServiceImpl.destroyIndex/destroyDefinedIndex/destroyIndexes), region destroy (LuceneServiceImpl.beforeRegionDestroyed/cleanupFailedInitialization, Tier0VectorBucketListener.afterRegionDestroy), and cache close (LuceneServiceImpl.close). - PR2-B2 & PR2-B5: Harden Tier0MetadataMatcher to evaluate TermRangeQuery, WildcardQuery, PrefixQuery, RegexpQuery, AutomatonQuery, TermInSetQuery, BoostQuery, ConstantScoreQuery, MatchNoDocsQuery; decode 1D PointRangeQuery strictly by enclosing Lucene point class (IntPoint/FloatPoint/LongPoint/DoublePoint); return false on pure-MUST_NOT/empty BooleanQuery; and fail closed on unsupported query subclasses and non-1D point queries. - PR2-B3: Run Tier0VectorBucketListener.afterPrimary with pdxReadSerializedOverride=true using EntrySnapshot.getRawValue(true) and lock-free Tier0VectorDeltaBuffer.putIfAbsent so hydration never deserializes PDX domain classes or resurrects concurrent afterDestroy tombstones. - PR2-B4: Pin active epoch and evict from both E_active and E_flushing in evictCommitted, and guard abortFlush with a monotonic clear generation so concurrent clear() can never have entries resurrected. - Add reproducing unit tests (Tier0MetadataMatcherParityJUnitTest, Tier0VectorLifecycleAndBucketListenerJUnitTest, Tier0VectorDeltaBufferJUnitTest concurrency stress tests) and DUnit test destroyAndRecreateIndexClearsTier0AndLeaksZeroStaleEntries.
…ush() and |T_mask| capping - Harden Tier0VectorDeltaBuffer.snapshot() to read E_flushing strictly before E_active and re-validate volatile stateRef against concurrent beginFlush(), abortFlush() (which restores E_flushing -> E_active strictly before clearing E_flushing), and clear() generation resets so migrating entries are never missed. - Cap inline MUST_NOT mask terms in DistributedHybridKnnFunction by Math.min(MAX_INLINE_MASK_TERMS, Math.max(0, IndexSearcher.getMaxClauseCount() - 2)) before falling back to bounded oversampling. - Add 10,000-iteration multi-threaded concurrency stress test snapshotNeverMissesLiveEntriesAcrossTenThousandBeginAndAbortFlushIterations.
…ter flush fallback - Add per-bucket promotion hydration barrier (beginHydration/awaitHydration/completeHydration) in Tier0VectorRegistry wired into Tier0VectorBucketListener.afterPrimary and DistributedHybridKnnFunction.executeOnBucket so concurrent reads wait briefly until primary bucket hydration populates Tier0VectorDeltaBuffer, closing mid-failover RAW gaps. - Add Tier0MetadataMatcher.isSupported(Query) recursive AST check and automatic synchronous bucket flush + commitAndRefreshBlocking fallback in DistributedHybridKnnFunction when an unsupported filter (e.g., FuzzyQuery/SpanQuery) encounters non-empty Tier-0, tracked via unsupportedFilterFlushFallbackCount telemetry, eliminating silent fail-closed drops. - Add reproducing unit tests (Tier0MetadataMatcherParityJUnitTest, Tier0VectorLifecycleAndBucketListenerJUnitTest, DistributedHybridKnnFunctionJUnitTest) and multi-VM DUnit test unsupportedFuzzyFilterQueryFlushesTier0AndReturnsFreshWritesWithoutSilentDrops.
…g path telemetry - Add rerankOversampleFactor (default 1 = disabled, validated in [1, 64]) to HybridKnnQueryContext and update sanctioned-geode-lucene-serializables.txt. - Add default queryWithFp32Rerank(...) on IndexRepository and implement it on IndexRepositoryImpl using per-leaf ascending ScoreDoc ordering for monotonic FloatVectorValues.advance(docInLeaf), scoring raw FP32 .vec vectors with VectorSimilarityScorer and returning top-k hits. - Wire DistributedHybridKnnFunction.executeOnBucket(...) to invoke queryWithFp32Rerank(...) when rerankOversampleFactor > 1 while preserving masked-key exclusions and Tier-0 union precedence. - Add server-side masking path telemetry counters (INLINE_MASK_QUERY_COUNT, OVERSAMPLE_FALLBACK_QUERY_COUNT, resetMaskTelemetry, and mirrored counters on Tier0VectorRegistry). - Add reproducing unit tests for >3*B_max concurrent partial-drain RAW visibility (Tier0VectorDeltaBufferJUnitTest), SQ8 FP32 reranking over multi-leaf 256-D Lucene99HnswScalarQuantizedVectorsFormat, and inline vs oversample mask telemetry (DistributedHybridKnnFunctionJUnitTest).
…d clamp deserialized rerankOversampleFactor
…nt reconciliation and strict iso-efS rerankBeamCandidates
… and AEQ-delta ordering/telemetry - Add evictionVersion seqlock + evictionLock fallback in Tier0VectorDeltaBuffer.snapshot() alongside (epoch, sequence) precedence and in-compute sequence allocation so stale E_flushing tombstones never mask evicted newer live recreations or concurrent puts. - Add per-bucket pathBBarrierLock in Tier0VectorDeltaBuffer and hold writeLock across Path-B unsupported-filter flush, snapshot(), and IndexSearcher acquisition (IndexRepository/IndexRepositoryImpl onSearcherAcquired hook), reading BucketRegion VM entries lock-free first in readRegionValueForFlush to prevent AB-BA deadlocks. - Harden AEQ-delta shadow-event ordering by (shadowKey, timestamp, shadowBucket < tempQueue) and expose lastHydrationEventsInspected / lastHydrationKeysRestored on Tier0VectorRegistry. - Add deterministic JUnit and multi-VM DUnit regression tests.
…on, and flush telemetry
4 of 6 tasks
added 20 commits
November 25, 2026 10:53
…and promotion fallback live-key tests
…rtial AEQ promotion gap
…dence and Path-A seq binding
…cket buffers across retries, and prevent Path-B abortFlush deadlock - Extract acquireSearcher and acquireSearcherAtEpoch in IndexRepositoryImpl so searcherManager.acquire precedes post-acquire searcherEpoch validation across executeQuery and executeQueryWithFp32Rerank, releasing mismatched searchers cleanly and enforcing expectedEpoch on the k<=0 guard. - Add resolveBucketBuffer and acquireLatestPathBWriteBarrier in DistributedHybridKnnFunction to re-await promotion hydration and rebind across demotion/re-promotion retries and Path-B barriers, extract query helpers, and avoid holding pathBWrite across in-flight flush backoff so completeFlush/abortFlush cannot livelock. - Add deterministic JUnit tests in DistributedHybridKnnFunctionJUnitTest covering abortFlush epoch binding on both query paths, re-promotion retry rebinding, and Path-B barrier non-deadlock.
…ss Path A and Path B - Track a monotonic, ABA-free per-bucket ownershipGeneration in Tier0VectorRegistry advanced on every afterPrimary/hydration, afterSecondary, afterBucketRemoved, removeIndex, removeRegion, and clearAll transition (plus LuceneBucketListener.afterPrimary and Tier0PartitionListener.afterPrimary), and add ownershipFenceRetryCount telemetry plus pinned flushBuffer helper. - Remove pathBBarrierLock.readLock() from Tier0VectorDeltaBuffer.clear() (retaining evictionLock/generation/SEALED_BIT synchronization) so bucket deposition callbacks cannot deadlock against an in-flight Path-B write barrier. - Validate ownershipGeneration, local primary ownership (BucketAdvisor.isPrimary), buffer identity, !isHydrating, and !repo.isClosed both before snapshot() and immediately after IndexSearcher acquisition on Path A (optimistic and contention fallback) and Path B (unsupported-filter write barrier), failing over via PrimaryBucketException on permanent demotion or refreshing repo/buffer/generation on local re-promotion. - Add deterministic JUnit and 3-VM DUnit tests (inFlightReadInvalidatesAndRetriesAcrossBucketDemotionAndRePromotion) plus lifecycle monotonicity unit test.
…d explicit retry-exhaustion abort - Add a canonical per-bucket single-flight ReentrantLock (flushLock) in Tier0VectorRegistry shared with Tier0VectorDeltaBuffer, held across LuceneEventListener AEQ read/update/commitAndRefreshBlocking/evictCommitted and Tier0VectorRegistry.flushBuffer beginFlush/update/commitAndRefreshBlocking/completeFlush/abortFlush so competing flushers can never interleave IndexWriter writes, commits, refreshes, evictions, or aborts. - Strictly preserve lock hierarchy (flushLock -> pathBBarrierLock -> evictionLock): flushBuffer acquires flushLock non-blockingly via tryLock() when pathBWrite is held, and DistributedHybridKnnFunction.flushBucketForUnsupportedFilter releases pathBWrite while waiting on flushLock before re-validating ownershipGeneration. - Add explicit retry-exhaustion abort exits (PrimaryBucketException -> InternalFunctionInvocationTargetException) across ownership retries, Path-A odd-epoch/contention wait exhaustion, Path-B flush wait exhaustion, and post-loop !cutCompleted guard so executeOnBucket never falls through to merge an unvalidated cut. - Add deterministic JUnit tests covering retry exhaustion (ownership, odd epoch, Path-B stuck flush), AEQ vs Path-B single-flight serialization + abortFlush serialization, and canonical flushLock sharing.
…te Path-A/Path-B publication-window races
…ttedKeySequences stale-AEQ rejection, and post-commit/pre-refresh recovery
…rwrite/delete adoption across promotion
…ittedKeySequences after new-term flush/eviction
…=0 provisional vs seq>=1 live) and verify Path-B full drain > B_max after commit/refresh abort
…tomically fence seal-to-commit hydration via evictionLock, and verify paused-before-pin adoption
…nitor, linearize promotion cut at t_hyd (hydrationLatch release), and verify post-gen-change writer + second promotion
…lushLock before boundEntry lookup (seq=1 delayed, seq=2 committed, seq=3 live overwrite/tombstone)
…Put/recordDestroy boundary (overwrite + destroy) across two chained promotions
…linearizability, strengthen inter-promotion read checks, and verify pre-recovery rollback boundary
… history partition, add fully-replicated unpinned write & VersionTag recovery ordering tests
…ge & Path-B lock-order docs, rf>=2 Class G/L docs & contention/demotion/abort/3-backup tests
…ey ASC) base collector & 1-doc-per-key docs, Class G sufficiency/rollback Javadoc & overwrite test
… toString) across Tier-0/Lucene FP32/final merge, injective keyTerm domain & shared FP32 scorer docs, Class G over M(t) incl. observations through absence & tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR 2: Dual-Epoch Tier-0 Vector Delta Buffer and Distributed Hybrid k-NN Function
feature/GEODE-vector-pr2-hybrid-knndevelop(46643af515)41316b8c9e87ae9228b6df69b9fea9724830dee6(23 files changed, +21548 / -17)geode-lucene(Apache Geode 2.1, bundled Apache Lucene9.12.3)For all changes, please confirm:
GEODE-*JIRA ticket assignment and commit prefix update.)develop)?.vecreranking & masking path telemetry, sparse-leafFloatVectorValues.advanceguard & symmetric deserialization clamp, AEQ-delta promotion hydration withdeleteIfAbsent& strict iso-efSrerankBeamCandidates, snapshot seqlock fence + Path-B write barrier + AEQ-delta shadow ordering/telemetry, cross-tiersearcherEpochfence + stale-index reconciliation + true flush-cycle telemetry, atomic Tier-0mutationVersionoverlay snapshot fence + promotion fallback live-key overwrite/delete-recreate coverage, pre-pin two-writer snapshot race closure + unconditional post-AEQ full-bucket reconciliation, sequence-fenced authoritative promotion precedence + Path-A payload-to-seq binding, epoch-bound searcher acquisition + retry buffer rebinding + non-deadlocking Path-B abortFlush backoff, monotonic ABA-free per-bucketownershipGenerationfence across Path A and Path B, canonical per-bucket single-flightflushLock+ explicit retry-exhaustion abort exits, immutableDeltaEntry.regionValuebinding eliminating Path-A/Path-B publication-window races, Path-A pre-pin fence + monotoniccommittedKeySequencesstale-AEQ regression rejection + post-commit/pre-refresh recovery, primary-crash replicate-before-pin overwrite & delete promotion-adoption verification, committed-sequence hydration fence rejecting stale promotion-scan installs after new-term flush & eviction, unified promotion hydration sequence guard (PROVISIONAL_HYDRATION_SEQUENCE = 0LvsLIVE_SEQUENCE_START = 1L) + Path-B full drain> B_maxacross commit/refresh aborts, unconditional Path-B mask/snapshot reset + atomicevictionLockcross-epochE_flushingseal-to-commit hydration fence,RegionEntry-synchronized hydration reads +t_hydpromotion cut linearization athydrationLatchrelease + chained second-promotion verification, unconditional Path-A stale-AEQ drop guard beforeboundEntrylookup across live overwrites and tombstones, primary-crash verification at the backup-replication-to-recordPut/recordDestroyboundary for overwrite & destroy across two chainedrf=2promotions, two-tier global cross-promotion vs. ownership-term-local linearizability specification with explicit inter-promotion read & pre-recovery rollback-boundary verification, Theorem 2(1) observable read contract documentation, History Class G/L cross-promotion partition, and fully-replicated unpinned write &VersionTagrecovery ordering verification, deterministic Tier-0(score DESC, key ASC)tie-break fix + per-codec merge semantics & Path-B non-blockingflushLock.tryLock()drop-and-retry lock-order documentation + arbitraryrf >= 2Class G/L partition generalization + 3-backup partial-subset & Path-B contention/demotion/post-commit-pre-refresh abort verification, exhaustive FP32 pre-truncation(score DESC, key ASC)base collector (exhaustiveFp32/executeQueryExhaustiveFp32) + 1-visible-doc-per-key invariant docs + Class G sufficiency/observable-rollback Javadoc & acked-overwrite supersession verification, and shared canonical total key order (CanonicalKeyOrder) across Tier-0/Lucene FP32/final merge + injectivekeyTerm& shared FP32 scorer bit-identity documentation + full abstract bucket stateM(t)Class G/L observations-through-absence specification & reference-oracle tests — ready to squash on upstream submission.)gradlew buildrun cleanly? (Verified:geode-lucene:spotlessCheck,:geode-lucene:checkPom,:geode-lucene:javadoc,:geode-lucene:test --rerun,:geode-lucene:distributedTest --tests "*HybridKnn*" --rerun, and:geode-lucene:integrationTest --tests "*AnalyzeLuceneSerializablesIntegrationTest*" --rerun.)9.12.3.)Summary / Motivation
Geode's
geode-luceneindex updates flow asynchronously through anAsyncEventQueue(AEQ) before committing to region-backed Lucene HNSW segments. Under concurrent ingestion, this creates a read-after-write visibility gap where recently written or deleted vectors are invisible (or stale) until AEQ flush, commit, andSearcherManager.maybeRefreshBlocking()complete.This PR introduces a lock-free dual-epoch Tier-0 in-memory vector delta buffer (
E_active/E_flushing) paired with a distributed hybrid k-NN function (DistributedHybridKnnFunction) that unions fresh Tier-0 vectors with committed Lucene HNSW segments while masking deleted/superseded keys:searcherEpochFence: Dual-epochTier0VectorDeltaBuffercaptures puts (with immutableDeltaEntry.regionValue), updates, and tombstones immediately on the primary bucket viaTier0VectorBucketListener, tracks monotonic per-keycommittedKeySequencesand canonical(membershipID, realThreadID, sequenceID)pinnedEventSequences, and retires entries only after AEQ flush + Lucene commit + searcher refresh. Under per-bucket single-flightflushLock,LuceneEventListener.processeliminates unfenced empty-buffer fallbacks on Tier-0-managed buckets: unpinned AEQ events defer cleanly (return false) until Tier-0 pins them (preventing pre-linearization publication), pinned entries index strictly immutableDeltaEntrypayloads and advancecommittedKeySequencesatomically beforeevictCommittedEntries, and delayed stale AEQ events withpinnedSeq <= maxCommittedSequence(k)are dropped without overwriting Lucene; Path B drains strictly immutableFlushBatch<K>payloads sealed bybeginFlush().snapshot()verifies(active.writerState.get() & WRITER_MASK) == 0BEFORE readingm1 = mutationVersion.get()and validatesactiveWriterStateAfter == 0beforem2, whileinsertIfAbsent,recordMutation, andrestoreEntryToActiveincrementmutationVersionboth before and after mutatingactive.entriesinside the writer pin—paired withIndexRepositorysearcherEpochvalidation (tryQueryAtEpoch/tryQueryWithFp32RerankAtEpoch) and per-bucketownershipGenerationfencing across Tier-0 and Tier-1.Tier0MetadataMatcherevaluates LuceneQuerypredicates over buffered Tier-0 entries with exact parity against LuceneIndexSearcher(includingTermRangeQuery,WildcardQuery,PrefixQuery,RegexpQuery,AutomatonQuery,TermInSetQuery, 1DPointRangeQuery,BooleanQuery,BoostQuery,ConstantScoreQuery, andMatchNoDocsQuery). Unsupported queries (e.g.,FuzzyQuery/SpanQuery) acquire the per-bucketpathBBarrierLockwrite lock and drain bothE_activeandE_flushingcompletely untilbuffer.getTotalSize() == 0 && !buffer.isFlushing()across flush, snapshot, andIndexSearcheracquisition soT_maskis guaranteed empty at the searcher cut even with> B_maxpending keys. On primary promotion,Tier0VectorBucketListener.afterPrimaryseeds provisional AEQ deltas atPROVISIONAL_HYDRATION_SEQUENCE = 0LviatryHydrateFromAeqDeltaAND unconditionally runs sequence-fencedputIfSequenceBefore(..., LIVE_SEQUENCE_START)/deleteIfSequenceBefore(..., LIVE_SEQUENCE_START)(LIVE_SEQUENCE_START = 1L) inhydrateFromFullBucketScanso authoritativebucketlive entries, tombstones, and stale Lucene docs (collectIndexedKeysIfReady() \ liveKeySet) ALWAYS overwrite conflicting provisional AEQ state (seq < 1L) while preserving concurrent live or already-committed new-term mutations (seq >= 1LorcommittedKeySequences >= 1L).DistributedHybridKnnFunctionexecutes per-bucket filtered k-NN across both Tier-0 and Tier-1 (Lucene HNSW), handles tombstone masking with adaptive oversampling fallback, supports exact FP32.vecreranking (both oversampledSQ8+RRkand strict iso-efSearchrerankBeamCandidatesatrerankOversampleFactor=1), and merges per-bucket top-k results across the cluster.Key Changes
Tier-0 Dual-Epoch Delta Buffer, Pre-Pin Seqlock Fence & Sequence-Fenced Authoritative Promotion
Tier0VectorDeltaBuffer(org.apache.geode.cache.lucene.internal.vector):E_active/E_flushing) map usingSEALED_BITpinning so concurrent writes never block flush handoff andevictCommitted(...)cleans both epochs without stranding entries.evictionVersion+mutationVersion): IncrementsmutationVersionBOTH before and after mutatingactive.entriesinside the writer pin inrecordMutation(),insertIfAbsent(), andrestoreEntryToActive(), guardsbeginFlush(),completeFlush(), andabortFlush()withpathBBarrierLock.readLock()(pathBBarrierLock -> evictionLockorder everywhere;clear()synchronizes onevictionLock/generation/SEALED_BITwithout takingpathBBarrierLock.readLock()so bucket deposition callbacks cannot deadlock against an in-flight Path-B write barrier), and drains sealedE_flushingwriters ininsertIfAbsent(). Optimisticsnapshot()requires(v1 & 1) == 0 && (active.writerState.get() & WRITER_MASK) == 0BEFORE readingm1 = mutationVersion, scansE_flushingthenE_active, readsactiveWriterStateAfterBEFOREm2, and validatesv1 == v2 && m1 == m2 && after.active == active && after.flushing == flushing && (activeWriterStateAfter & WRITER_MASK) == 0, falling back topathBBarrierLock.writeLock() -> synchronized (evictionLock)when contended. Enforces(epoch, sequence)precedence (DeltaEntry.isNewerThan) so olderE_flushingputs never mask newerE_activedeletes (tombstonedKeys&maskedKeys).evictionLockHydration Fence: DefinesPROVISIONAL_HYDRATION_SEQUENCE = 0L(stamped byputProvisionalIfAbsent/deleteProvisionalIfAbsentwithout advancingsequenceGenerator) vsLIVE_SEQUENCE_START = 1L(stamped by live mutations and authoritative bucket-scan installs), removing any separateprovisionalHydrationshadow flag.insertOrOverwritewraps pin + cross-epoch (E_flushing,committedKeySequences,E_active) check-and-install atomically insidesynchronized (evictionLock)(strictly afterpathBBarrierLock.readLock(), preserving lock hierarchyflushLock -> pathBBarrierLock -> evictionLock -> active.writerState) and enforces the single unified predicate(existing == null || existing.sequence < maxExclusiveSeq) && !isBlockedByCommittedSequence(key, maxExclusiveSeq)alongside checkingstateRef.get().flushinginsideactive.entries.compute(key, ...)— so a delayed hydration scan resuming in thebeginFlushseal-to-commit window deterministically observes sealedE_flushingentries (or advancedcommittedKeySequences >= 1LifcompleteFlushacquiredevictionLockfirst) and rejects stale installs (-1L), whilecompleteFlushmerges onlyseq > 0LintocommittedKeySequencesandclear()is invoked exclusively byTier0VectorRegistrystrictly after detaching the buffer and advancingownershipGeneration.pathBBarrierLock): Uses a per-bucketReentrantReadWriteLock(readLockonput/destroy/putIfAbsent/deleteIfAbsent/evictCommitted/beginFlush/completeFlush/abortFlush;writeLockvialockPathBWrite()/unlockPathBWrite()across unsupported-filter flush ->snapshot()->IndexSearcheracquisition).Tier0VectorRegistry,Tier0VectorBucketListener,PartitionedRepositoryManager, &LuceneEventListener:ownershipGeneration(getOwnershipGeneration,advanceOwnershipGeneration,ownershipFenceRetryCount, pinnedflushBuffer) advanced on everyafterPrimary,afterSecondary,afterBucketRemoved,beginHydration,completeHydration,removeBucket,removeIndex,removeRegion, andclearAlltransition, plus a canonical per-bucket single-flightReentrantLock(getBucketFlushLockshared withTier0VectorDeltaBuffer.getFlushLock), hooking intoPartitionedRepositoryManager,LuceneBucketListener,LuceneEventListener,IndexRepositoryImpl,LuceneIndexImpl, andLuceneServiceImpl.DeltaEntryPayload Binding, MonotoniccommittedKeySequences& Canonical Event-ID Tracking (getEntry,evictCommittedEntries,pinnedEventSequences): ExtendsDeltaEntry<K>withprivate final Object regionValue(getRegionValue()) populated directly byTier0VectorBucketListenerfromevent.getNewValue()(and authoritative bucket values on promotion hydration); tracks per-keycommittedKeySequences(getMaxCommittedSequence,recordCommittedSequence) updated atomically underflushLock+evictionLockstrictly BEFORE clearing/evicting incompleteFlush(long),evictCommitted, andevictCommittedEntriesacross puts, overwrites, deletes, and recreations (never advanced onabortFlush); and normalizesEventIDviaThreadIdentifier.getRealThreadID(id.getThreadID())intopinnedEventSequences/nonVectorEventIds(publishingeventId -> seqstrictly afterE_activeinstallation and releasing viaacknowledgeEventIdsonly after a batch returnstrue, bounding memory toO(|AEQ_b|)).flushLock, Path-A Pre-Pin/Stale-AEQ Fences & Post-Commit/Pre-Refresh Recovery: On Tier-0-managed buckets (Tier0VectorRegistry.markIndexManaged/isIndexManaged),LuceneEventListener.processholdsflushLockacross the entire bucket cycle and eliminates unfenced empty-buffer fallbacks: (1) unpinned AEQ events (pinnedSeq < 0Lorbuffer == null) defer cleanly (deferredUnpinnedAeqEventsCount, returningfalsefor AEQ retry without writing to Lucene or bumpingsearcherEpoch), (2) strictly beforebuffer.getEntry(k), delayed stale AEQ events (eventId != null && maxCommittedSeq > 0L && pinnedSeq <= maxCommittedSeq) are dropped unconditionally (staleAeqEventsDroppedCount, zero Lucene writes/commits, live Tier-0 entry undisturbed, preservingseq == 0Lprovisional shadow events whenmaxCommittedSeq == 0L), and (3) pinnedboundEntryentries verifyboundEntry.getSequence() > maxCommittedSeq(andpinnedSeq >= boundEntry.getSequence()on legacy metadata-only fallback), bind strictly immutableboundEntry(DeltaEntry.regionValue/tombstone), commit & blocking-refresh, advancecommittedKeySequences, and callbuffer.evictCommittedEntries(committedEntries)without regressing Lucene across overwrites or tombstones.Tier0VectorRegistry.flushBufferholds the sameflushLockacrossbeginFlush -> update/delete -> commitAndRefreshBlocking -> completeFlush/abortFlush(flushLock -> pathBBarrierLock -> evictionLock), and interruption afterIndexWriter.commit()beforemaybeRefreshBlocking()/ eviction restores evensearcherEpoch, keepsw_1visible inE_active(masking Lucene viaT_mask), and drains cleanly to0on retry.removeIndex,removeRegion,removeCache) acrossdestroyIndex,destroyDefinedIndex,destroyIndexes,beforeRegionDestroyed,afterRegionDestroy,cleanupFailedInitialization, andcloseso destroy/recreate cycles leak zero stale entries.afterPrimaryremoves thebucket.isEmpty()early return, enforcessetPdxReadSerializedOverride(true)(restored infinally), synchronizes each bucket-entry/tombstone read on its per-keyRegionEntrymonitor (synchronized (re), released strictly beforeputIfSequenceBefore/deleteIfSequenceBeforeso hydration never observes an un-replicated local write prior toUpdateOperation.startOperation()/distributeDestroyOperation()and every scan-observed write survives subsequent chained promotions), and performs provisional AEQ-delta hydration + unconditional sequence-fenced authoritative reconciliation:tryHydrateFromAeqDeltapopulates provisional AEQ entries (PROVISIONAL_HYDRATION_SEQUENCE = 0L) fromAsyncEventQueueImpl->ParallelGatewaySenderQueue/ConcurrentParallelGatewaySenderQueueusingShadowEventRecordordering (effectiveShadowKey,timestamp,shadowBucket=0 < tempQueue=1,orderIndex), andhydrateFromFullBucketScanunconditionally runs sequence-fencedputIfSequenceBefore(..., LIVE_SEQUENCE_START)/deleteIfSequenceBefore(..., LIVE_SEQUENCE_START)(1L) over (1)bucket.keySet(), (2)bucket.getRegionMap().regionEntries()(re.isTombstone()), and (3)PartitionedRepositoryManager.collectIndexedKeysIfReady(bucketId) \ liveKeySetso authoritative bucket state ALWAYS overwrites conflicting provisional AEQ state (seq == 0L) while preserving concurrent live or already-committed new-term mutations (seq >= 1LorcommittedKeySequences >= 1L), linearizing the promotion cut att_hydimmediately beforecompleteHydrationreleaseshydrationLatch.FlushCycleRing/FlushCycleSample):Tier0VectorRegistryprovides bounded per-bucketrecordFlushCycle,drainFlushCycleSamples, andsetFlushCycleSamplingEnabled(zero overhead when disabled), populated byLuceneEventListener.processwith(batchSize, preEvictTier0Size, flushDurationNanos).beginHydration/awaitHydration/completeHydrationwired in bothDistributedHybridKnnFunctionandLuceneEventListener) and records hydration telemetry counters (hydratedKeysCount,hydratedTombstonesCount,aeqDeltaHydrationCount,fullScanHydrationCount,lastHydrationEventsInspected,lastHydrationKeysRestored,reconciledStaleIndexKeysCount).Metadata Filtering, Cross-Tier
searcherEpochValidation & Distributed Query ExecutionTier0MetadataMatcher&VectorSimilarityScorer:KnnFloatVectorQueryacrossCOSINE,DOT_PRODUCT, andEUCLIDEAN.Tier0MetadataMatcher.isSupported(Query)recursive AST checking; decodes 1DPointRangeQuerystrictly by enclosing Lucene point class (IntPoint/FloatPoint/LongPoint/DoublePoint), rejectsNaN, returnsfalseon empty or pure-MUST_NOTBooleanQuery(matching LuceneIndexSearcher), and fails closed (false) on unsupported query subclasses or multi-dimensional point queries.DistributedHybridKnnFunction,HybridKnnQueryContext, &IndexRepository/IndexRepositoryImpl:searcherEpoch, BucketownershipGenerationFence & Explicit Retry-Exhaustion Abort:IndexRepositoryImplmaintainsAtomicLong searcherEpoch(incrementingeven -> oddbeforewriter.commit()andodd -> evenaftersearcherManager.maybeRefreshBlocking()/maybeRefresh()inside synchronizedcommit()/commitAndRefreshBlocking()) and implementsgetSearcherEpoch(),tryQueryAtEpoch(...),tryQueryWithFp32RerankAtEpoch(...), andcollectIndexedKeys(), extractingacquireSearcher/acquireSearcherAtEpochacross bothexecuteQueryandexecuteQueryWithFp32ReranksosearcherManager.acquire()precedes post-acquiresearcherEpochvalidation (releasing mismatched searchers cleanly and checkingexpectedEpochon thek <= 0 || oversampleK <= 0guard).DistributedHybridKnnFunctionwraps Path A (optimistic + contention fallback) and Path B (unsupported-filter write barrier) in an outer ownership-fence retry loop (MAX_OWNERSHIP_FENCE_RETRIES=16) validatingownershipGeneration == expectedGen, local primary ownership (BucketAdvisor.isPrimary()),!isHydrating,getBuffer == expectedBuffer, and!repo.isClosed()BOTH beforesnapshot()AND immediately afterIndexSearcheracquisition (insideonSearcherAcquired, beforesearcher.search()and while holdingpathBWriteon Path B), failing over viaPrimaryBucketException->InternalFunctionInvocationTargetExceptionon permanent demotion, ownership retry exhaustion, Path-A odd-epoch/contention wait exhaustion, Path-B flush-wait exhaustion, and an explicit post-loopif (!cutCompleted)guard (never falling through to merge an unvalidated cut), or refreshingrepo/buffer/ownershipGenerationon local re-promotion..vecreranking viaIndexRepository.queryWithFp32Rerank(...)/IndexRepositoryImpl: supports bothrerankOversampleFactorin[1, 64](default1) andrerankBeamCandidates(boolean)(isRerankBeamCandidates()), so whenrerankOversampleFactor == 1 && rerankBeamCandidates == true(SQ8+RR-iso),queryK = luceneK(strict iso-efSearch with zero beam inflation) still executesrepo.queryWithFp32Rerank(...)over HNSW beam candidates. Groups hits per leaf in ascending docID order for monotonicFloatVectorValues.advance(...), rescores raw FP32 vectors viaVectorSimilarityScorer, and returns top-k.tier0Snapshot = nullandmaskedKeys = Collections.emptySet()strictly before enteringacquireLatestPathBWriteBarrier/flushBucketForUnsupportedFilter(guaranteeing zero staleS_live/T_maskcarryover even when the buffer is already empty after an epoch mismatch), loop insideflushBucketForUnsupportedFilteruntil BOTHE_activeandE_flushingare completely empty (buffer.getTotalSize() == 0 && !buffer.isFlushing())—draining strictly immutableentry.getRegionValue()already sealed insideFlushBatch<K>frombeginFlush()without touching live mutableBucketRegion.getEntry(k)or acquiringRegionEntrylocks; while holdingpathBBarrierLock.writeLock(),Tier0VectorRegistry.flushBufferacquiresflushLockstrictly via non-blockingflushLock.tryLock()(never blocking, preserving zero AB-BA lock-order inversion against Path A'sflushLock -> pathBBarrierLock.readLock -> evictionLock), droppingpathBWriteimmediately on contention to back off in bounded<= 10 msslices before re-acquiringpathBWriteand re-validatingownershipGeneration(aborting cleanly viaPrimaryBucketExceptionif demoted during retry, and preserving non-regressing Tier-0 visibility viaabortFlush+ monotonicsearcherEpochon post-commit/pre-refresh abort)—then executesnapshot()andIndexSearcheracquisition (onSearcherAcquiredvalidatingownershipGenerationand local primary ownership underpathBWrite), releasing the write lock cleanly viafinallyonce the searcher cut is acquired soT_maskis guaranteed empty (even with> B_maxpending keys or after a commit/refresh abort) and concurrent matching overwrites are never dropped.CanonicalKeyOrder.compareCanonicalKeys,SCORE_DESC_KEY_ASC,WORST_FIRST) comparing(k.getClass().getName(), String.valueOf(k))with an unsignedSerializerUtil.toKeyTerm(k).bytes()tie-break fallback (nullfirst, soInteger(1) < Long(1L) < String("1")never collide), wired identically across all 4 stages (Tier0VectorDeltaBuffer.Snapshot.search,IndexRepositoryImpl.executeQueryExhaustiveFp32,IndexRepositoryImpl.executeQueryWithFp32Rerank, andDistributedHybridKnnFunction.SCORE_DESC_COMPARATOR), paired with an explicitexhaustiveFp32mode (HybridKnnQueryContext.exhaustiveFp32(boolean),IndexRepository.queryExhaustiveFp32/tryQueryExhaustiveFp32AtEpoch, andIndexRepositoryImpl.executeQueryExhaustiveFp32) scanning every eligible live doc across allLeafReaderContextleaves via a boundedk'min-heap ordered byCanonicalKeyOrder.WORST_FIRSTbefore base top-k'truncation, documented injectiveSerializerUtil.toKeyTermkey domain + 1-visible-doc-per-key Lucene invariant (writer.updateDocuments/delete+APPLY_ALL_DELETES=trueso oversampling byk' = k + |T_mask|is strictly sufficient across multi-leaf indexes), and bit-identical sharedVectorSimilarityScorerFP32 kernels (scoreBatchvsscore) pre- and post-flush.INLINE_MASK_QUERY_COUNT,OVERSAMPLE_FALLBACK_QUERY_COUNT,unsupportedFilterFlushFallbackCount, andownershipFenceRetryCounttelemetry counters.kwith pre-truncation canonical(score DESC, key ASC)forexhaustiveFp32; unified FP32 scale cut-consistent visibility forSQ8+RR-iso/RR-mand unquantized FP32 HNSW ANN; cut-consistent cross-tier visibility for plainSQ8), exact Path-B lock order, 1-visible-doc-per-key invariant, and arbitraryrf >= 2(S subseteq P(b)) History Class G vs. Class L defined uniformly over full abstract bucket stateM(t): K -> (V x Meta) U {bot}and query dependencer = Q_{F,k}(M(t_r))(covering live hits, tombstones/bot, filter exclusions, top-komissions, and observations through absence across both partially replicated creates and partially replicated destroys — unconditionally covering 100% of acknowledged writes, 100% of fully-replicated unpinned writesS = P(b)with zero re-replication, pre-hydration recovery, and acked-overwrite/destroy supersession) inTier0VectorDeltaBuffer,DistributedHybridKnnFunction,Tier0VectorRegistry,Tier0VectorBucketListener,SerializerUtil, andVectorSimilarityScorerJavadoc.New Unit & Distributed Tests (88 Unit + 21 DUnit)
Tier0VectorDeltaBufferJUnitTest(23 tests): dual-epoch concurrency stress (put/evict/flush/abort/clear), atomicdeleteIfAbsenttombstone insertion without overwriting concurrent live post-promotion puts or flushing entries, sequence-fencedputIfSequenceBefore/deleteIfSequenceBeforeoverwritingseq == 0Lprovisional entries while preservingseq >= 1Llive writes, no-commit two-keymutationVersiontorn-cut fencing including deterministic pre-pinned two-writer schedule (snapshotNoCommitPreventsTwoKeyTornCut,snapshotNoCommitConcurrentTwoKeyScheduleNeverExposesOldXNewY,snapshotNoCommitPrePinnedTwoWritersNeverExposesOldXNewY), olderE_flushingput vs newerE_activedelete resolution, deterministic snapshot seqlock fencing againstevictCommittedandcompleteFlushmid-snapshot plus 1,500-cycle evict-and-recreate churn stress, 10,000-iteration concurrentsnapshot()vsbeginFlush()/abortFlush()zero-miss stress test,> 3 * B_maxconcurrent partial-drain RAW visibility stress test, zero visibility gap, tombstone masking, and score equivalence across all similarity functions.Tier0MetadataMatcherParityJUnitTest(5 tests):isSupported(Query)AST classification, ground-truth parity against LuceneIndexSearcher, cross-type 1DPointRangeQuerydecoding, pure-MUST_NOTboolean behavior, and fail-closed checks.Tier0VectorLifecycleAndBucketListenerJUnitTest(17 tests): deterministic concurrent promotion hydration barrier test, PDX read-serialized override without domain deserialization, Path-AevictCommittedpreserving post-read overlay puts/destroys (pathAFlushDoesNotEvictNewerOverlayPutWrittenAfterPayloadRead), primary AEQ-delta hydration reconciling uncommitted puts and pre-crash tombstones inO(|AEQ_b|), authoritative bucket overwriting conflictingseq == 0Lprovisional AEQ state withseq >= 1Lwhile preserving post-promotion live writes, out-of-order same-keyShadowEventRecord&tempQueuetiebreak resolution, partial non-empty AEQ unconditional reconciliation of missing overwrites, inserts, deletes, and expired tombstones, empty-bucket pre-crash tombstone hydration,RegionMaptombstone fallback scan on empty buckets, fallback reconciliation of stale indexed keys with missing AEQ and expired region tombstones, fallback live-key reconciliation across acknowledged overwrites, unindexed inserts, and delete-recreates,LuceneEventListenertrue flush-cycle sample recording & disabled flag behavior, primary hydration tombstone safety, full registry cleanup on destroy/close, ABA-freeownershipGenerationstrict monotonicity across lifecycle transitions, and canonicalflushLocksharing betweenTier0VectorRegistryandTier0VectorDeltaBuffer(bucketFlushLockSharedBetweenRegistryAndDeltaBuffer).DistributedHybridKnnFunctionJUnitTest(43 tests): multi-bucket union, tombstone masking, oversampling fallback, server-side inline vs oversample mask telemetry counters, SQ8 multi-leaf 256-D exact FP32.vecreranking recall & score parity, strict iso-efSearchrerankBeamCandidatesFP32 rerank without beam inflation, deterministic(score DESC, key ASC)tie-break ordering across Tier-0 and hybrid merge when> kentries tie (deterministicTieBreakOrdersEqualScoresByKeyAscendingAcrossTier0AndMerge), exhaustive FP32 pre-truncation(score DESC, key ASC)across multi-leaf (>= 2leaves) 1-live-doc-per-key Lucene base + Tier-0 provingexhaustiveFp32(true)selects"a"over lower-docId"b"and tied Tier-0"c"across Path A (inline mask + oversample fallbackk' = k + |T_mask|) and Path B (exhaustiveFp32TieBreakAppliesScoreDescKeyAscBeforeBaseTruncationAcrossLeavesAndTier0), sharedCanonicalKeyOrdertotal key order across tiedInteger(1),Long(1L),String("1"),Integer(2),String("2")+ all-4-metricscoreBatchvsscorebit-identity + injectivetoKeyTerm+ exact bit-identical pre-flush (inline mask + oversample fallback), Path B flush, and post-flush top-k(k=1..8) against a reference oracle (exhaustiveFp32TotalKeyOrderAndPrePostFlushScoreEquivalenceAgainstReferenceOracle), observations through absence across partially replicated createxonB1only and partially replicated destroy of ackedy=v0onB1only proving Class L rollback boundaries vs. Class G preservation under transfer and acked destroy/re-put supersession on both Path A and Path B (observationsThroughAbsencePartiallyReplicatedCreateAndDestroyShowClassLBoundaryAndClassGPreservation), observed partially replicated unacked writew_1(x=v1)superseded by acked overwritew_2(x=v2)replicating directlyv0 -> v2ontoB2preserving global linearizability acrossB1crash andB2promotion on Path A and Path B (observedPartiallyReplicatedWriteSupersededByAckedOverwritePreservesGlobalLinearizability), supported-filtersearcherEpochvalidation preventing two-key torn cuts +abortFlushconsistent-cut binding across both query paths + 16-retry write-barrier fallback + re-promotion retry buffer rebinding, deterministic bucket demotion/re-promotion ownership fence invalidation & retry across Path A (rerankBeam=false/truewith unchangedsearcherEpoch), Path B (FuzzyQueryunderpathBWritewith zero deadlock), Path-B contention drop-and-retry against Path AflushLock+ demotion-during-retry ownership abort + post-commit/pre-refresh non-regressing recovery (pathBContentionDropAndRetryDemotionDuringRetryAndPostCommitPreRefreshAbort), and permanent demotion failover, explicit retry-exhaustion abort throws across ownership/stuck odd epoch/Path-B stuck flush, single-flightflushLockserialization across AEQ commit/evict vs Path-B flush/abort preventing stalev1overwritingv2with zero deadlock, writer paused betweenBucketRegionupdate and Tier-0 pin verified across both Path A and Path B (0BucketRegionreads,0deadlock,0unpinnedw_2leakage,evictCommittedEntriespreserving mid-commitw_2), Path-A pre-pin fence +committedKeySequencesstale-AEQ regression rejection (across overwrite and delete-recreate) + unconditional stale-AEQ drop guard whenseq=1arrives delayed whileseq=2is committed andseq=3is live in Tier-0 for both overwrite and tombstone through refresh and eviction (pathADelayedSeq1EventDroppedWhenSeq2CommittedAndSeq3LiveOverwriteInTier0,pathADelayedSeq1EventDroppedWhenSeq2CommittedAndSeq3LiveTombstoneInTier0) + post-commit/pre-refresh interruption recovery, primary crash at replicate-before-pin boundary adopting interrupted overwrite and delete atomically att_adoptbeforehydrationLatchopens, primary crash strictly after backup replication and before old-primaryrecordPut/recordDestroyadopting both overwrite and destroy cleanly att_hydwith explicit inter-promotion readr_1onB1and surviving chained second promotion ontoB2onceB1 -> B2redundancy recovery completes (primaryCrashAfterReplicationBeforeRecordPutAndDestroyAdoptsAtHydrationAndSurvivesSecondPromotion), pre-recovery crash ofB1-only unacknowledged write demonstrating the ownership-term-local rollback boundary ontoB2(preRecoveryCrashOfB1OnlyUnackedWriteDemonstratesOwnershipTermLocalRollbackBoundary), 3-backup partial-subset{B1, B3}vsB2tracing both Class L local rollback beforeB3 -> B2and Class G preservation afterB3 -> B2completes beforet_hyd(B2)(threeBackupPartialSubsetDemonstratesClassLRollbackAndClassGRecoveryPreservation), fully-replicated unpinned overwrite & destroy surviving chainedB1 -> B2promotions with zero re-replication (fullyReplicatedUnpinnedWriteSurvivesChainedPromotionsWithZeroReReplication), GeodeVersionTag(VersionStamp.processVersionTag/ConcurrentCacheModificationException) recovery ordering preserving newerB1-term writew_newover stale adopted old-term GII chunkw_oldacrossB1 -> B2promotion (redundancyRecoveryVersionTagOrderingPreservesNewerB1TermWriteOverAdoptedOldTermWrite), delayed promotion scan rejecting stale captured values/tombstones viacommittedKeySequencesafter new-term overwrite/destroy/recreate flushes and evicts, Path-B full drain of1,200(> B_max) pending keys across post-commit/pre-refresh interruption leavinggetTotalSize() == 0 && !isFlushing()and zero tombstoned ghosts, Path-B already-empty fallback after 16 optimistic epoch mismatches resettingtier0Snapshot/maskedKeyscleanly, delayed promotion scan resuming inbeginFlushseal-to-commit window rejecting stale installs via atomicevictionLock+E_flushingcheck, new-term writer paused beforerecordPutduringafterPrimaryadopted cleanly athydrationLatchwith idempotent post-resume pin, post-generation-change pre-pin writer linearizing strictly inside[inv(w_2), resp(w_2)]att_hyd(hydrationLatchrelease) withsynchronized (re)hydration mutual exclusion, atomic multi-key cut, monotonicw_2'overwrite, and chained second-promotion survival (postGenerationChangePrePinWriterLinearizesAtHydrationLatchPreservesMultiKeyCutAndSurvivesSecondPromotion), Path-B write-barrier lock acrossonSearcherAcquiredblocking concurrent overwrites/recreations + non-deadlock against in-flightabortFlush+ exception cleanup +IndexRepositoryImplsearcher hook ordering, sparse/mixed-leafFloatVectorValues.advancemonotonicity guard under-ea, symmetricrerankOversampleFactordeserialization clamp, flush/abort error handling, and end-to-endFuzzyQueryunsupported-filter flush-and-refresh fallback verification.DistributedHybridKnnFunctionDistributedTest(21 DUnit tests): read-after-write visibility before AEQ flush, filtered selectivity regimes (1%, 5%, 50%), concurrent writes + continuous queries, bucket rebalancing recall parity, failover AEQ-delta hydration reconciling pre-crash tombstones with zero ghosts and draining|T_mask|to zero onevictCommitted, failover same-keyput->destroy->recreate&put->destroywithlastHydrationEventsInspected/lastHydrationKeysRestoredtelemetry, promotion overwriting conflicting AEQ state with authoritative bucket live entries and tombstones and draining cleanly, supported-filtersearcherEpochpreventing two-key torn cuts across servers, 3-VM in-flight read ownership-generation invalidation & retry across bucket demotion/re-promotion on Path A and Path B, 3-VM liveregion.put(v2)paused insideBucketRegion.basicPutPart2(synchronized (RegionEntry)held, before Tier-0 pin) during BOTH Path B (FuzzyQuery) and Path A (LuceneEventListener.processEvents), 3-VM end-to-end Path-A pre-pin fence + delayed stale AEQ rejection across Path-B commit/evict & delete-recreate + post-commit/pre-refresh interruption recovery, 3-VM primary crash strictly after synchronous replication of both an overwrite and a destroy prior to Tier-0 pin verifying continuous reader observes strictly pre-adoption or atomic adopted cut att_hyd, 3-VM post-promotion new-term overwrite/destroy/recreate flush & eviction rejecting delayed promotion-scan installs (putIfSequenceBefore/deleteIfSequenceBefore/putIfAbsent/deleteIfAbsentreturning-1L) on both Path A and Path B, 4-VMrf=2chained second-promotionkill -9verification of post-generation-change writer gating,t_hydhydration cut, pre-flushw_2'overwrite, and lossless survival across a second promotion on both Path A and Path B (postGenerationChangeWriterDuringPromotionLinearizesAtHydrationCutAndSurvivesSecondPromotion), 4-VMrf=2primary crash strictly after synchronous backup replication of both overwrite and destroy prior to old-primaryrecordPut/recordDestroy(with zero client retry ontopromoted1), verifying explicit inter-promotion readr_1onpromoted1(ownershipGeneration > 0),backup2successor-durable state, and losslessr_2survival across immediate secondkill -9ontobackup2before Lucene flush on both Path A and Path B (primaryCrashAfterBackupReplicationBeforeRecordPutAndDestroySurvivesTwoPromotions), promotion stale Lucene doc reconciliation with missing AEQ and expired tombstone yielding zero ghosts, promotion fallback with missing AEQ covering live overwrites, unindexed inserts, and delete-recreates, partial non-empty AEQ on promotion reconciling missing acked overwrites, inserts, and deletes, Path-BFuzzyQueryzero dropped matching entries under concurrent overwrites, destroy/recreate zero-leak verification, and multi-VMFuzzyQueryunsupported-filter flush-and-refresh fallback with paused AEQ.Backward Compatibility & Serialization Notes
org.apache.geode.cache.lucene.internal.*. ExistingIndexRepositoryandLuceneBucketListeneradditions are internal interfaces/hooks that do not alter existing lexical query or AEQ behavior when no Tier-0 vector buffer is registered.DistributedHybridKnnFunctionandHybridKnnQueryContext(includingexhaustiveFp32:booleanandrerankBeamCandidates:boolean, and usingsimilarityFunctionName: Stringrather than third-party Lucene enums forObjectInputFiltercompatibility) insanctioned-geode-lucene-serializables.txt, verified viaAnalyzeLuceneSerializablesIntegrationTest(6/6 PASS).Exact Gradle Verification Commands & Pass Counts
:geode-lucene:test --rerun:geode-lucene:distributedTest --tests "*HybridKnn*" --rerun(DistributedHybridKnnFunctionDistributedTest)AnalyzeLuceneSerializablesIntegrationTest:geode-lucene:spotlessCheck,:checkPom,:javadoc