Repository navigation
Conversation
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
ConsensusSubscriptionCommitState.stageCommittedAndAdvancepreviously found the next committed and outstanding entries by scanning the full backlog maps. With N outstanding entries from one writer and reverse-order ACKs, every ACK repeatedly scanned O(N) entries, producing a real O(N^2) ACK path.I reproduced the behavior by calling the production
ConsensusSubscriptionCommitStatewith a single writer:Each value is the best of three warmed runs. The baseline grows super-linearly as the backlog doubles; the indexed path does not. The new per-writer
TreeSetindexes preserve the existing slot maps for exact ACK removal and make successor lookup logarithmic.Remote-change check:
Testing
mvn -Ddevelocity.off=true spotless:apply -pl iotdb-core/datanodemvn -Ddevelocity.off=true -pl iotdb-core/datanode checkstyle:check -DskipTestsConsensusSubscriptionCommitStateTest: 19/19 passed, including a 2,048-entry reverse-ACK regression case.git diff --checkThe normal full DataNode compile is currently blocked by existing workspace SNAPSHOT/source inconsistencies (
SubscriptionQueueAdmissionand related classes) and a Windows compiler native-memory failure; the changed manager and targeted test were compiled directly against the existing DataNode build artifacts.Changed files
ConsensusSubscriptionCommitManagerConsensusSubscriptionCommitStateTest