Skip to content
Merged
Show file tree
Hide file tree
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 @@ -519,6 +519,14 @@ private void validateTransactionManager() {
LedgerError.CONFIG_GROUP_COMMIT_MUST_BE_DISABLED.buildMessage(
ConsensusCommitConfig.COORDINATOR_GROUP_COMMIT_ENABLED));
}
if (consensusCommitConfig.isCoordinatorWriteOmissionOnReadOnlyEnabled()) {
LOGGER.warn(
"Disabling the unsupported option '{}' because Coordinator writes are always necessary for ScalarDL",
ConsensusCommitConfig.COORDINATOR_WRITE_OMISSION_ON_READ_ONLY_ENABLED);
props.setProperty(
ConsensusCommitConfig.COORDINATOR_WRITE_OMISSION_ON_READ_ONLY_ENABLED,
Boolean.toString(false));
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -581,4 +581,38 @@ public void constructor_HmacEnabledButCipherKeyNotGiven_ShouldThrowIllegalArgume
// Assert
assertThat(thrown).isExactlyInstanceOf(IllegalArgumentException.class);
}

@Test
public void
constructor_ConsensusCommitWithCoordinatorWriteOmissionDisabledSpecified_ShouldConstructProperly() {
// Arrange
props.setProperty(DatabaseConfig.TRANSACTION_MANAGER, "consensus-commit");
props.setProperty(
ConsensusCommitConfig.COORDINATOR_WRITE_OMISSION_ON_READ_ONLY_ENABLED, "false");

// Act
LedgerConfig config = new LedgerConfig(props);
ConsensusCommitConfig consensusCommitConfig =
new ConsensusCommitConfig(config.getDatabaseConfig());

// Assert
assertThat(consensusCommitConfig.isCoordinatorWriteOmissionOnReadOnlyEnabled()).isFalse();
}

@Test
public void
constructor_ConsensusCommitWithCoordinatorWriteOmissionEnabledSpecified_ShouldConstructProperlyWithDisablingIt() {
// Arrange
props.setProperty(DatabaseConfig.TRANSACTION_MANAGER, "consensus-commit");
props.setProperty(
ConsensusCommitConfig.COORDINATOR_WRITE_OMISSION_ON_READ_ONLY_ENABLED, "true");

// Act
LedgerConfig config = new LedgerConfig(props);
ConsensusCommitConfig consensusCommitConfig =
new ConsensusCommitConfig(config.getDatabaseConfig());

// Assert
assertThat(consensusCommitConfig.isCoordinatorWriteOmissionOnReadOnlyEnabled()).isFalse();
}
}