Skip to content

HDDS-17701. Honor ScmRatisServerConfig.logAppenderWaitTimeMin in RatisUtil - #12134

Open
mitsa-ng wants to merge 1 commit into
apache:masterfrom
mitsa-ng:HDDS-17701
Open

mitsa-ng wants to merge 1 commit into
apache:masterfrom
mitsa-ng:HDDS-17701

Conversation

@mitsa-ng

Copy link
Copy Markdown

JIRA: https://issues.apache.org/jira/browse/HDDS-17701

What / Why

ozone.scm.ha.raft.server.log.appender.wait-time.min defined in ScmRatisServerConfig (default 0ms) was never wired into the RaftProperties built by RatisUtil.newRaftProperties. The typed default only reached Ratis when the annotation-generated hdds-common-default.xml happened to be loaded as a raw property and picked up by the trailing prefix-copy, so in environments without that resource on the classpath (for example IDE test runs, see HDDS-17700) Ratis fell back to its own 1ms default and the conf was effectively ignored.

What this does

  • RatisUtil.setRaftLogProperties now sets Log.Appender.waitTimeMin from the ScmRatisServerConfig object, mirroring how appendEntriesComposeEnabled is already wired in the same method, so the conf is honored independently of the raw-property copy path.
  • The Ratis-server-config assertions of TestSCMConfiguration#testSCMConfig moved into a dedicated testScmRatisServerConfigRaftProperties, which also asserts a user-configured wait time (setLogAppenderWaitTimeMin(7) plus setFromObject).

Verification

  • Reproduced the HDDS-17700 failure on trunk by removing hdds-common-default.xml from the test classpath: TestSCMConfiguration.testSCMConfig:217 raft.server.log.appender.wait-time.min ==> expected: <0ns> but was: <1ms>
  • With this change the same environment passes: Tests run: 7, Failures: 0, Errors: 0 in TestSCMConfiguration
  • Normal environment: mvn -pl hadoop-hdds/server-scm checkstyle:check test -Dtest=TestSCMConfiguration passes (7/7, checkstyle clean)

…sUtil

The ozone.scm.ha.raft.server.log.appender.wait-time.min conf defined in
ScmRatisServerConfig was never wired into the RaftProperties built by
RatisUtil.newRaftProperties: the typed default (0ms) only reached Ratis
when the annotation-generated hdds-common-default.xml happened to be on
the classpath, so in environments without that resource (e.g. IDE test
runs, see HDDS-17700) Ratis fell back to its own 1ms default.

Set Log.Appender.waitTimeMin from the ScmRatisServerConfig object the
same way appendEntriesComposeEnabled is already set, so the conf is
honored independently of the raw-property copy path, and move the
Ratis-server-config assertions of TestSCMConfiguration#testSCMConfig
into a dedicated testScmRatisServerConfigRaftProperties which also
checks a user-configured wait time.
@github-actions github-actions Bot added the scm label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant