Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -676,8 +676,10 @@ private void testMergeViewIndexSequencesHelper(boolean isNamespaceMappingEnabled
afterUpgradeAllocations.add(new SequenceAllocation(sequenceUpgrade, 1));
long[] afterUpgradeValues = new long[1];
SQLException[] afterUpgradeExceptions = new SQLException[1];
cqs.incrementSequences(afterUpgradeAllocations, EnvironmentEdgeManager.currentTimeMillis(),
afterUpgradeValues, afterUpgradeExceptions);
// The merge can create the new sequence in the current millisecond.
// A read at the latest timestamp sees that row, as NEXT VALUE FOR does without an SCN.
cqs.incrementSequences(afterUpgradeAllocations, HConstants.LATEST_TIMESTAMP, afterUpgradeValues,
afterUpgradeExceptions);

assertNull(afterUpgradeExceptions[0]);
int safetyIncrement = 100;
Expand All @@ -697,8 +699,10 @@ private SequenceKey createViewIndexSequenceWithOldName(ConnectionQueryServices c
MetaDataUtil.getOldViewIndexSequenceKey(tenantId, viewIndexTable, 0, isNamespaceMapped);
// Sequences are owned globally even if they contain a tenantId in the name
String sequenceTenantId = isNamespaceMapped ? tenantId : null;
// A sequence read sees only cells older than the read timestamp.
// Create the legacy sequence one millisecond in the past, so that each later read sees it.
cqs.createSequence(sequenceTenantId, key.getSchemaName(), key.getSequenceName(), Long.MIN_VALUE,
1, 1, Long.MIN_VALUE, Long.MAX_VALUE, false, EnvironmentEdgeManager.currentTimeMillis());
1, 1, Long.MIN_VALUE, Long.MAX_VALUE, false, EnvironmentEdgeManager.currentTimeMillis() - 1);
return key;
}

Expand Down
Loading