Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

Permalink
improvement: Fast forward timestamp to be able to use txn3 (#6921)
Browse files Browse the repository at this point in the history
We fast forward logical timestamp on workload server by 10M so we can use transactions3.
  • Loading branch information
LucasIME authored Jan 29, 2024
1 parent dd4d1f1 commit 175f86f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions atlasdb-workload-server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ dependencies {
implementation project(':timestamp-api')
implementation project(':lock-api')
implementation project(':lock-api-objects')
implementation project(':timestamp-api')

implementation 'com.fasterxml.jackson.core:jackson-annotations'
implementation 'com.fasterxml.jackson.core:jackson-databind'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,15 @@ public static AtlasDbTransactionStoreFactory createFromConfig(
.build()
.serializable();

fastForwardTimestampToSupportTransactions3(transactionManager);

return new AtlasDbTransactionStoreFactory(
transactionManager, installConfig.namespace().or(installConfig.keyValueService()::namespace));
}

private static void fastForwardTimestampToSupportTransactions3(TransactionManager transactionManager) {
long currentTimestamp = transactionManager.getTimestampService().getFreshTimestamp();
long guaranteedTransaction3Timestamp = currentTimestamp + 10_000_000;
transactionManager.getTimestampManagementService().fastForwardTimestamp(guaranteedTransaction3Timestamp);
}
}
6 changes: 6 additions & 0 deletions changelog/@unreleased/pr-6921.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type: improvement
improvement:
description: We fast forward logical timestamp on workload server by 10M so we can
use transactions3.
links:
- https://github.com/palantir/atlasdb/pull/6921

0 comments on commit 175f86f

Please sign in to comment.