Conversation
…exed write path Two allocation/CPU cleanups that fire on every indexed batch: - MetricsIndexerSourceImpl: memoize the resolved per-(table, base-metric) MetricHistogram/MutableFastCounter handles instead of rebuilding the "base.table" name string and re-resolving the registry handle on every update. The (base, table) set is small and bounded and the handles are stable for the life of the source, so steady-state per-batch allocation at getCounterName drops to zero. Metric names, values, and JMX output are unchanged. - IndexRegionObserver: doPre/doPost emitted updatePreIndexUpdateTime / updatePostIndexUpdateTime unconditionally, even when doIndexWritesWithExceptions short-circuited with no index updates to write -- recording a near-zero sample every batch on tables with no pre/post index work. doIndexWritesWithExceptions now returns whether it actually wrote, and the callers only record the timing metric when it did. Failure metrics are unchanged.
…ive index write path On the active path every generated index-mutation cell carries the batch-wide timestamp (set by setTimestamps), so re-scanning each mutation's cells with the O(cells) IndexUtil.getMaxTimestamp on every index-prepare step was wasted work. Introduce indexMutationTimestamp(context, m): use context.batchTimestamp on the active path, fall back to getMaxTimestamp only on the standby replay path (which regenerates index updates per (row, ts) group, where the mutation's own timestamp is authoritative). Make context.batchTimestamp the single source of truth for the index-prepare chain: set it once where it is computed and drop the now-redundant batchTimestamp parameter threaded through prepareAndCommitGlobalIndexUpdates, preparePreIndexMutations, and prepareIndexMutations. Also drop the never-used timestamp parameter from prepareDataRowStates/applyPendingPutMutations. Standby path is unchanged (byte-for-byte). Validated by GlobalIndexCheckerIT, GlobalIndexCheckerEventualGenerateIT, UncoveredGlobalMutableNonTxIndexIT, and ReplicationLogGroupIT.
tkhurana
marked this pull request as draft
September 16, 2026 05:08
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.
No description provided.