-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
storage: avoid copying marshalled RaftCommand when encoding
Informs #36347. This change avoids the unnecessary allocation and memory copy present in Raft command encoding. This extra work is expensive for large commands like `AddSSTable` requests. Even for smaller requests, this work was still a serious problem because it took place under heavily contended locks. For instance, the encoding in `defaultSubmitProposalLocked` took place under the Replica mutex, which serializes all Raft proposals for a Range. The other two locations fixed took place under the Raft mutex. While less heavily contended, this was still slowing down the Raft processing goroutine. This is a less dramatic version of a change I've been working on. The full change lifts the slice allocation and most of the RaftCommand proto marshalling all the way out of `defaultSubmitProposalLocked` and out of the `Replica.mu` critical section. This commit gets us part of the way there sets the stage for the rest of the change. Release note: None
- Loading branch information
1 parent
422635c
commit 91abab1
Showing
5 changed files
with
51 additions
and
41 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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