fluss
fluss copied to clipboard
[server] Add a cluster feature gate to enable V3 log record batches
Search before asking
- [x] I searched in the issues and found nothing similar.
Motivation
Part of #5088. #5089 adds the V3 log record batch format, but nothing should write V3 until every tablet server can read, replicate and recover it. Users enable V3 once, after the whole cluster has been upgraded, and the cluster must not accept it earlier.
Solution
- Add the cluster config
cluster.feature.log.record-batch.version. It defaults to 2, is raised to 3 withAlterClusterConfigsand is never lowered. - Tablet servers record the highest level they support in their ZooKeeper registration. Registrations without it count as level 2.
- The coordinator only accepts level 3 once every registered tablet server supports it.
- Add PRODUCE_LOG v2, advertised only once level 3 is applied. The leader rejects V3 batches when the request version or the local level does not allow them.
- Add FETCH_LOG v1 for readers of V3 batches. A FETCH_LOG v0 reader that reaches V3 data gets a version error, until the conversion for old clients in #5089 is added.
- Document the config.
- Open: how to keep out an old tablet server that registers after V3 is enabled, for example by rejecting it at registration.
- Tests: raising the level with an old tablet server registered, lowering the level, V3 writes before and after enabling, replication of V3 batches, and FETCH_LOG v0 readers.
Willingness to contribute
- [x] I'm willing to submit a PR!