Skip to content

feat(load): route decoded tsfile pieces through consensus - #18432

Draft
luoluoyuyu wants to merge 4 commits into
apache:masterfrom
luoluoyuyu:load-tsfile-consensus-ha
Draft

feat(load): route decoded tsfile pieces through consensus#18432
luoluoyuyu wants to merge 4 commits into
apache:masterfrom
luoluoyuyu:load-tsfile-consensus-ha

Conversation

@luoluoyuyu

Copy link
Copy Markdown
Member

Description


This PR has:

  • been self-reviewed.
    • concurrent read
    • concurrent write
    • concurrent read and write
  • added documentation for new or modified features or behaviors.
  • added Javadocs for most classes and all non-trivial methods.
  • added or updated version, license, or notice information
  • added comments explaining the "why" and the intent of the code wherever would not be obvious
    for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold
    for code coverage.
  • added integration tests.
  • been tested in a test IoTDB cluster.

Key changed/added classes (or packages if there are too many classes) in this PR

@luoluoyuyu
luoluoyuyu marked this pull request as draft August 10, 2026 06:44
@luoluoyuyu
luoluoyuyu force-pushed the load-tsfile-consensus-ha branch from 900bd81 to 6db4491 Compare August 13, 2026 03:03
@luoluoyuyu
luoluoyuyu force-pushed the load-tsfile-consensus-ha branch 2 times, most recently from b34eee0 to a17672e Compare August 20, 2026 10:48
@luoluoyuyu
luoluoyuyu force-pushed the load-tsfile-consensus-ha branch from a17672e to ad27395 Compare August 21, 2026 03:19
…ross restart

Cleanup of LOAD replica information (task registry entry and staged files) now
happens only at the terminal phase:

- abortConsensus cleans up only after the ABORT marker was durably written;
  a failed marker write keeps the staged data for the coordinator's retry.
- commitConsensus already cleaned after the COMMIT marker + load; followers
  clean when they apply the replicated marker.
- The periodic idle-task eviction is removed (LoadCleanupScheduler deleted);
  there is no cleanup at any other time.
- Restart no longer deletes leftover task dirs: recover() rebuilds each task
  from a durable task.meta (applied-piece prefix + staged file list) and
  re-registers it so the load can continue. Graceful shutdown also stops
  deleting staged files (closeForShutdown only releases file handles).
- The staged file is forced before task.meta is persisted so the applied
  prefix never covers bytes that a machine crash could lose.
- A terminal.marker written right before cleanup lets restart discard only
  the leftovers of loads that already reached COMMIT/ABORT.
- Tasks whose durable meta is missing or corrupt are not resumed; they are
  left for the coordinator to fail loudly instead of forking the staged file.
commitConsensus now mirrors abortConsensus explicitly: the COMMIT marker is
written first, and only after it is durably logged (or this node applies the
replicated marker as a follower) may the staged files be loaded and cleaned
up. A marker write failure keeps the staged data for the coordinator's retry
and returns LOAD_FILE_ERROR instead of silently proceeding.
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