From cb37648f2590796777a6b336706761801693966a Mon Sep 17 00:00:00 2001 From: Antonio Murgia Date: Tue, 27 May 2025 17:24:11 +0200 Subject: [PATCH] PHOENIX-7620 --- .../org/apache/phoenix/coprocessor/SequenceRegionObserver.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phoenix-core-server/src/main/java/org/apache/phoenix/coprocessor/SequenceRegionObserver.java b/phoenix-core-server/src/main/java/org/apache/phoenix/coprocessor/SequenceRegionObserver.java index e5744bdc1cc..ea2d7fe675c 100644 --- a/phoenix-core-server/src/main/java/org/apache/phoenix/coprocessor/SequenceRegionObserver.java +++ b/phoenix-core-server/src/main/java/org/apache/phoenix/coprocessor/SequenceRegionObserver.java @@ -274,7 +274,7 @@ public Result preIncrement( limitReached = SequenceUtil.checkIfLimitReached(currentValue, minValue, maxValue, incrementBy, cacheSize, numSlotsToAllocate); // update currentValue - currentValue += incrementBy * (SequenceUtil.isBulkAllocation(numSlotsToAllocate) ? numSlotsToAllocate : cacheSize); + currentValue += incrementBy * (SequenceUtil.isBulkAllocation(numSlotsToAllocate) ? Math.max(numSlotsToAllocate, cacheSize) : cacheSize); // update the currentValue of the Result row Cell newCurrentValueKV = createKeyValue(row, PhoenixDatabaseMetaData.CURRENT_VALUE_BYTES, currentValue, timestamp); Sequence.replaceCurrentValueKV(cells, newCurrentValueKV);