Skip to content

Commit ed305ae

Browse files
committed
Extend applicability of one-phase commit optimization
1 parent 709b5a7 commit ed305ae

File tree

10 files changed

+2473
-1330
lines changed

10 files changed

+2473
-1330
lines changed

core/src/main/java/com/scalar/db/transaction/consensuscommit/CommitHandler.java

Lines changed: 447 additions & 35 deletions
Large diffs are not rendered by default.

core/src/main/java/com/scalar/db/transaction/consensuscommit/CommitHandlerWithGroupCommit.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,10 @@ public void commit(TransactionContext context)
6060
}
6161

6262
@Override
63-
boolean canOnePhaseCommit(TransactionContext context) throws CommitException {
63+
boolean canOnePhaseCommit(ValidationInfo validationInfo, TransactionContext context)
64+
throws CommitException {
6465
try {
65-
return super.canOnePhaseCommit(context);
66+
return super.canOnePhaseCommit(validationInfo, context);
6667
} catch (CommitException e) {
6768
cancelGroupCommitIfNeeded(context.transactionId);
6869
throw e;

core/src/main/java/com/scalar/db/transaction/consensuscommit/ConsensusCommitManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ DistributedTransaction begin(
263263
"Setting different isolation level from the one in DatabaseConfig might cause unexpected "
264264
+ "anomalies");
265265
}
266-
Snapshot snapshot = new Snapshot(txId, isolation, tableMetadataManager, parallelExecutor);
266+
Snapshot snapshot = new Snapshot(txId, tableMetadataManager);
267267
TransactionContext context =
268268
new TransactionContext(txId, snapshot, isolation, readOnly, oneOperation);
269269
DistributedTransaction transaction =

0 commit comments

Comments
 (0)