Eason09053360 opened a new pull request, #11096:
URL: https://github.com/apache/ozone/pull/11096
## What changes were proposed in this pull request?
`OzoneManagerRatisServer.newRaftProperties()` applies two different config
keys to the same
Ratis property, `raft.server.retrycache.expirytime`:
1. `setRaftRetryCacheProperties()` reads
`ozone.om.ratis.server.retry.cache.timeout`
(documented in `ozone-default.xml` with a `600000ms` default) and calls
`RaftServerConfigKeys.RetryCache.setExpiryTime()`.
2. The last statement of `newRaftProperties()` is
`getOMHAConfigs(conf).forEach(properties::set)`, which copies every
`ozone.om.ha.*`
property into the `RaftProperties` with the prefix trimmed.
`OzoneManagerRatisServerConfig` declares
`ozone.om.ha.raft.server.retrycache.expirytime`
with `@Config(defaultValue = "300s")`, which the config annotation
processor emits into
`ozone-manager-default.xml`. Since that is an `OzoneConfiguration`
default resource, the
key is always present even when the operator never sets it.
Step 2 runs after step 1, so `ozone.om.ratis.server.retry.cache.timeout` is
unconditionally
overwritten and can never take effect. Operators tuning the documented key
get no effect and
no warning, and the advertised `600000ms` default has never been the
effective value — the
effective default is `300s`.
Introduced by HDDS-4329 (46690430d7), which added the new config and the
`getOMHAConfigs()`
override without removing the old key.
This patch registers the old key as a deprecated alias of
`ozone.om.ha.raft.server.retrycache.expirytime`, so existing deployments
that set it keep
working (and now actually take effect, with a deprecation warning), then
removes the dead
`setRaftRetryCacheProperties()` path, the unused `OMConfigKeys` constants,
and the stale
`ozone-default.xml` entry.
### Compatibility note
No behaviour change for anyone who never set the old key: `300s` was already
the effective
value. For anyone who did set it, the configured value now takes effect
instead of being
silently discarded. That is the point of the fix, but it is operator-visible.
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-16254
## How was this patch tested?
New unit test `TestOzoneManagerRatisServer#testRetryCacheExpiryTime` asserts
all three cases:
the `300s` default, the current key being honoured, and the deprecated key
now reaching Ratis
instead of being overwritten.
* `TestOzoneManagerRatisServer` — 7/7 pass
* `TestOzoneConfiguration` — 48/48 pass
* `TestOzoneConfigurationFields` — 5/5 pass (guards `ozone-default.xml`
against the removed key)
* `checkstyle.sh` — 0 violations
Generated-by: Claude Code (Claude Opus 5)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]