Skip to content

Make IoTConsensusV2 the default DataRegion consensus protocol - #19398

Draft
Pengzna wants to merge 4 commits into
apache:masterfrom
Pengzna:codex/iotv2-default-it-validation
Draft

Pengzna wants to merge 4 commits into
apache:masterfrom
Pengzna:codex/iotv2-default-it-validation

Conversation

@Pengzna

@Pengzna Pengzna commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Switch the default DataRegion consensus protocol to IoTConsensusV2 in batch mode for newly initialized deployments. Align the integration-test wrappers and the HighPerformanceMode and ScalableSingleNodeMode fixtures with that default.

For example, start a fresh deployment with the packaged configuration and run SHOW VARIABLES. The DataRegionConsensusProtocolClass row previously showed org.apache.iotdb.consensus.iot.IoTConsensus and now shows org.apache.iotdb.consensus.iot.IoTConsensusV2. Existing deployments with an explicit protocol should continue using their configured value.

Region migration after DELETE

In a 1C3D cluster with two DataRegion replicas, insert rows at timestamps 100, 200, and 300, flush, delete timestamps through 200, then move one replica to the third DataNode. Previously, the new peer received the TsFile and mods, but migration could keep three replicas while waiting for the progress index of a delete already reclaimed from the deletion log. The historical consensus Pipe now reports materialized DELETE progress in commit order after its historical transfer. The expected final state is two replicas, with timestamp 300 as the only visible row on the destination. Both tree and table integration tests cover this scenario in batch and stream.

Test fixtures and validation

Update the ConfigNode registration and Edge fixtures for the new default. Resolve the REST and Grafana HTTP endpoints through the test environment so the same tests can run with RemoteIT.

The targeted local experiment before rebasing passed the six migration cases, 43 related unit tests, and the REST and Grafana cases in Remote and Simple modes. On the rebased head, the repository's IT selection check covers all 848 candidate classes. This draft tracks full traditional-database IT validation in GitHub Actions. The fork validation run covers DailyIT, ManualIT, RemoteIT, opt-in benchmarks, and the Simple and table-cluster profiles with the resources used in the local comparisons.

GitHub Actions results on fc2e2c35

  • Tree 1C3D, table 1C3D, table 1C1D, and Edge passed. Both migration classes reported 3/3 passing, covering IoTV2 batch, IoTV2 stream and the IoTV1 controls.
  • Tree 1C1D failed the same 31 methods on Ubuntu and across the three Windows shards. The DataNode logs show a WAL allocation failure at the 256 MiB direct memory cap. The full Ubuntu SimpleIT job at 768 MiB passed with 3234 passing and 81 skipped, including all 31 methods.
  • Multi-Cluster passed 16 of 17 jobs. In the remaining job, the table IoTDBPipeLifeCycleIT Log and Hybrid methods saw 10/100 and 110/200 rows at the receiver. Isolated protocol comparisons reproduced both readings with IoTV2. Both IoTV1 controls passed. A later diagnostic run passed Hybrid once and still failed Log, with 50/100 rows in the second database.
  • The Log failure showed a receiving DataNode classifying the same TsFile as empty before its first write and again after it had sealed with data. The consensus Pipe then skipped it. A candidate fix recomputes emptiness from the current file time bounds. On the fork, both Pipe methods passed three consecutive runs under IoTV2 and TsFileResourceTest passed 10/10. Candidate validation
  • The fork supplements passed DailyIT (113 passed, 3 skipped), ManualIT (4/4), RemoteIT (26/26), and four opt-in benchmark executions. Fork run
  • The resource-adjusted TableClusterIT job reported zero Failsafe failures in both attempts. The first attempt failed the final RAT license check on a generated fixture. The repeat kept the same IT settings and moved the fixture to a directory that RAT already excludes. The corrected job passed with 2329 passing and 612 skipped. Corrected run
  • The DataNode unit test jobs also reported failures, including LOAD staging and progress index expectations. These are tracked independently from the integration tests.

CI fixes on 2ff3701

  • Apply the TsFile emptiness fix and keep the existing Pipe lifecycle assertions.
  • Run tree 1C1D with 768 MiB of DataNode direct memory on Ubuntu and all three Windows shards. This is set in the test workflow.
  • Set the intended protocol in the LOAD and RPC test fixtures, and exercise both scheduling outcomes in the compaction test. All 84 related DataNode unit tests passed in a local JDK 17 Maven run.

All seven previously failing jobs passed on this revision. Tree 1C1D passed on Ubuntu and all three Windows shards. The table Pipe lifecycle shard passed its Multi-Cluster rerun. Ubuntu and Windows DataNode unit jobs each reported 6168 tests, zero failures and errors, and 48 skipped. Tree 1C1D · Pipe shard · Unit-Test

The standard traditional-database IT workflows finished with 29/29 jobs passing, including all 17 Multi-Cluster jobs. Unit-Test finished with 4/4 jobs passing. Multi-Cluster

  • Added or extended integration tests
  • Tested in a local IoTDB cluster before rebasing
  • Ran the traditional database integration-test profiles in GitHub Actions
  • Fix and rerun the seven previously failing jobs
Key changed areas

DataRegion consensus defaults, historical consensus Pipe progress, and integration-test fixtures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant