Skip to content

Commit

Permalink
Revert async commit default value (#797)
Browse files Browse the repository at this point in the history
  • Loading branch information
brfrn169 committed Jan 16, 2023
1 parent b9b1830 commit 98c8dda
Show file tree
Hide file tree
Showing 13 changed files with 8 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public ConsensusCommitConfig(DatabaseConfig databaseConfig) {
getBoolean(
databaseConfig.getProperties(), PARALLEL_ROLLBACK_ENABLED, parallelCommitEnabled);

asyncCommitEnabled = getBoolean(databaseConfig.getProperties(), ASYNC_COMMIT_ENABLED, true);
asyncCommitEnabled = getBoolean(databaseConfig.getProperties(), ASYNC_COMMIT_ENABLED, false);
asyncRollbackEnabled =
getBoolean(databaseConfig.getProperties(), ASYNC_ROLLBACK_ENABLED, asyncCommitEnabled);
isIncludeMetadataEnabled =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public void constructor_NoPropertiesGiven_ShouldLoadAsDefaultValues() {
assertThat(config.isParallelValidationEnabled()).isTrue();
assertThat(config.isParallelCommitEnabled()).isTrue();
assertThat(config.isParallelRollbackEnabled()).isTrue();
assertThat(config.isAsyncCommitEnabled()).isTrue();
assertThat(config.isAsyncRollbackEnabled()).isTrue();
assertThat(config.isAsyncCommitEnabled()).isFalse();
assertThat(config.isAsyncRollbackEnabled()).isFalse();
assertThat(config.isIncludeMetadataEnabled()).isFalse();
}

Expand Down Expand Up @@ -153,15 +153,15 @@ public void constructor_ParallelExecutionRelatedPropertiesGiven_ShouldLoadProper
public void constructor_AsyncExecutionRelatedPropertiesGiven_ShouldLoadProperly() {
// Arrange
Properties props = new Properties();
props.setProperty(ConsensusCommitConfig.ASYNC_COMMIT_ENABLED, "false");
props.setProperty(ConsensusCommitConfig.ASYNC_ROLLBACK_ENABLED, "false");
props.setProperty(ConsensusCommitConfig.ASYNC_COMMIT_ENABLED, "true");
props.setProperty(ConsensusCommitConfig.ASYNC_ROLLBACK_ENABLED, "true");

// Act
ConsensusCommitConfig config = new ConsensusCommitConfig(new DatabaseConfig(props));

// Assert
assertThat(config.isAsyncCommitEnabled()).isFalse();
assertThat(config.isAsyncRollbackEnabled()).isFalse();
assertThat(config.isAsyncCommitEnabled()).isTrue();
assertThat(config.isAsyncRollbackEnabled()).isTrue();
}

@Test
Expand Down
2 changes: 1 addition & 1 deletion docs/configurations-for-consensus-commit.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ The Performance related configurations for Consensus Commit are as follows:
| scalar.db.consensus_commit.parallel_validation.enabled | Whether or not the validation phase (in `EXTRA_READ`) is executed in parallel. | The value of `scalar.db.consensus_commit.parallel_commit.enabled` |
| scalar.db.consensus_commit.parallel_commit.enabled | Whether or not the commit phase is executed in parallel. | true |
| scalar.db.consensus_commit.parallel_rollback.enabled | Whether or not the rollback phase is executed in parallel. | The value of `scalar.db.consensus_commit.parallel_commit.enabled` |
| scalar.db.consensus_commit.async_commit.enabled | Whether or not the commit phase is executed asynchronously. | true |
| scalar.db.consensus_commit.async_commit.enabled | Whether or not the commit phase is executed asynchronously. | false |
| scalar.db.consensus_commit.async_rollback.enabled | Whether or not the rollback phase is executed asynchronously. | The value of `scalar.db.consensus_commit.async_commit.enabled` |
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ protected final Properties getProperties(String testName) {
ConsensusCommitConfig.COORDINATOR_NAMESPACE, Coordinator.NAMESPACE);
properties.setProperty(
ConsensusCommitConfig.COORDINATOR_NAMESPACE, coordinatorNamespace + "_" + testName);

// Async commit can cause unexpected lazy recoveries, which can fail the tests. So we disable
// it for now.
properties.setProperty(ConsensusCommitConfig.ASYNC_COMMIT_ENABLED, "false");
}
return properties;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ protected final Properties getProperties(String testName) {
ConsensusCommitConfig.COORDINATOR_NAMESPACE, Coordinator.NAMESPACE);
properties.setProperty(
ConsensusCommitConfig.COORDINATOR_NAMESPACE, coordinatorNamespace + "_" + testName);

// Async commit can cause unexpected lazy recoveries, which can fail the tests. So we disable
// it for now.
properties.setProperty(ConsensusCommitConfig.ASYNC_COMMIT_ENABLED, "false");
}
return properties;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@ protected final Properties getProperties(String testName) {
ConsensusCommitConfig.COORDINATOR_NAMESPACE, Coordinator.NAMESPACE);
properties.setProperty(
ConsensusCommitConfig.COORDINATOR_NAMESPACE, coordinatorNamespace + "_" + testName);

// Async commit can cause unexpected lazy recoveries, which can fail the tests. So we disable
// it for now.
properties.setProperty(ConsensusCommitConfig.ASYNC_COMMIT_ENABLED, "false");
}
return properties;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,6 @@ public void beforeAll() throws Exception {
properties.setProperty(
ConsensusCommitConfig.COORDINATOR_NAMESPACE, coordinatorNamespace + "_" + TEST_NAME);

// Async commit can cause unexpected lazy recoveries, which can fail the tests. So we disable it
// for now.
properties.setProperty(ConsensusCommitConfig.ASYNC_COMMIT_ENABLED, "false");

StorageFactory factory = StorageFactory.create(properties);
admin = factory.getStorageAdmin();
databaseConfig = new DatabaseConfig(properties);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@ private void modifyProperties(Properties properties, String testName) {
properties.getProperty(ConsensusCommitConfig.COORDINATOR_NAMESPACE, Coordinator.NAMESPACE);
properties.setProperty(
ConsensusCommitConfig.COORDINATOR_NAMESPACE, coordinatorNamespace + "_" + testName);

// Async commit can cause unexpected lazy recoveries, which can fail the tests. So we disable
// it for now.
properties.setProperty(ConsensusCommitConfig.ASYNC_COMMIT_ENABLED, "false");
}

protected abstract Properties getProps1(String testName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,6 @@ private Properties modifyProperties(Properties properties) {
properties.setProperty(
ConsensusCommitConfig.COORDINATOR_NAMESPACE, coordinatorNamespace + "_" + TEST_NAME);

// Async commit can cause unexpected lazy recoveries, which can fail the tests. So we disable it
// for now.
properties.setProperty(ConsensusCommitConfig.ASYNC_COMMIT_ENABLED, "false");

return properties;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ protected void initialize(String testName) throws IOException {
properties.setProperty(
ConsensusCommitConfig.COORDINATOR_NAMESPACE, coordinatorNamespace + "_" + testName);

// Async commit can cause unexpected lazy recoveries, which can fail the tests. So we disable
// it for now.
properties.setProperty(ConsensusCommitConfig.ASYNC_COMMIT_ENABLED, "false");

server = new ScalarDbServer(properties);
server.start();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ protected void initialize(String testName) throws IOException {
properties.setProperty(
ConsensusCommitConfig.COORDINATOR_NAMESPACE, coordinatorNamespace + "_" + testName);

// Async commit can cause unexpected lazy recoveries, which can fail the tests. So we disable
// it for now.
properties.setProperty(ConsensusCommitConfig.ASYNC_COMMIT_ENABLED, "false");

server = new ScalarDbServer(properties);
server.start();
} else {
Expand All @@ -51,10 +47,6 @@ protected AdminTestUtils getAdminTestUtils(String testName) {
properties.setProperty(
ConsensusCommitConfig.COORDINATOR_NAMESPACE, coordinatorNamespace + "_" + testName);

// Async commit can cause unexpected lazy recoveries, which can fail the tests. So we disable
// it for now.
properties.setProperty(ConsensusCommitConfig.ASYNC_COMMIT_ENABLED, "false");

return new ServerAdminTestUtils(properties);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ protected void initialize(String testName) throws IOException {
properties.setProperty(
ConsensusCommitConfig.COORDINATOR_NAMESPACE, coordinatorNamespace + "_" + testName);

// Async commit can cause unexpected lazy recoveries, which can fail the tests. So we disable
// it for now.
properties.setProperty(ConsensusCommitConfig.ASYNC_COMMIT_ENABLED, "false");

server = new ScalarDbServer(properties);
server.start();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ private Properties modifyProperties(Properties properties, String testName) {
properties.setProperty(
ConsensusCommitConfig.COORDINATOR_NAMESPACE, coordinatorNamespace + "_" + testName);

// Async commit can cause unexpected lazy recoveries, which can fail the tests. So we disable
// it for now.
properties.setProperty(ConsensusCommitConfig.ASYNC_COMMIT_ENABLED, "false");

return properties;
}

Expand Down

0 comments on commit 98c8dda

Please sign in to comment.