Draft
Conversation
316c777 to
e9ac801
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces a new consensus implementation
TRaftfor Apache IoTDB, with partition-aware log replication for time-series ingestion and a compatible extension to consensus request time access.Content1: TRaft protocol implementation (leader/follower replication + election comparator)
TRaftConsensusandTRaftServerImplas the core runtime for TRaft.TRaftLogEntry(includestimestamp,partitionIndex, intra-partition metadata, Raft index/term)TRaftFollowerInfo(tracks per-follower replication partition progress and in-flight indices)TRaftLogStore(shared persistent log for all followers)TRaftVoteRequest/TRaftVoteResult(term + TRaft freshness dimensions)partitionIndex, thencurrentPartitionIndexCount.Design choice note:
Shared log was selected to reduce memory overhead and avoid duplicate persistence.
Content2:
IConsensusRequesttime capability extension and write-plan compatibilityIConsensusRequestwith:hasTime()(defaultfalse)getTime()(default throwsUnsupportedOperationException)InsertRowNode,InsertRowsNode,InsertTabletNodeInsertRowsOfOneDeviceNode,InsertMultiTabletsNodeRelationalInsertRowNode,RelationalInsertRowsNode,RelationalInsertTabletNodePipeEnrichedInsertNodedelegateshasTime()/getTime()InsertRowsOfOneDeviceNode#getMinTime()InsertMultiTabletsNode#getMinTime()Design choice note:
hasTime/getTime).getTime()return type toOptionalLong.Rejected due to signature conflict with existing
InsertRowNode#getTime()(long) and broad compatibility impact.This PR has:
Key changed/added classes (or packages if there are too many classes) in this PR
iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/traft/TRaftConsensusTRaftServerImplTRaftLogEntryTRaftFollowerInfoTRaftLogStoreTRaftNodeRegistryTRaftRequestParserTRaftVoteRequestTRaftVoteResultTRaftRoleiotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/common/request/IConsensusRequestIndexedConsensusRequestBatchIndexedConsensusRequestDeserializedBatchIndexedConsensusRequestiotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/write/InsertNodeInsertRowNodeInsertRowsNodeInsertRowsOfOneDeviceNodeInsertTabletNodeInsertMultiTabletsNodeRelationalInsertRowNodeRelationalInsertRowsNodeRelationalInsertTabletNode