-
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: reduce allocations during fingerprinting
If no rangekeys are encountered during fingerprinting the underlying SSTWriter does not write any data to the SST, but still produces a non-empty SST file. This file contains an empty data block, properties and a footer that amount to 795 bytes. Since the file does not contain any rangekeys it is going to be thrown away on the client side, and so ferrying this file in the ExportResponse is wasteful. Experiments on the c2c/kv0 roachtest showed that fingerprinting a single range ~250MB would result in 600k+ empty files. This magnitude of pagination was all attributable to the elastic CPU limiter that preempts an ExportRequest if it is consuming more CPU than it was allotted. 600k+ empty files meant that we were buffering close to 500MB of ExportResponse_Files (600k * 790bytes) on the node serving the ExportRequest. This was then shipped over grpc to the client where we were opening a multi-mem iterator over these 600k+ empty files causing a node with 15GiB RAM to OOM. Since fingerprinting does not set a `TargetBytes` on the export requests it sends, in a cluster with more than one ranage there could be several requests concurrently buffering these empty files, resulting in an even more pronounced memory blowup. This change ensures that the MemFile is nil'ed out if there are no rangekeys encountered during the fingerprinting. This change also returns nil values for the `BulkOpSummary` and `Span` field of the `ExportResponse` when generated as part of fingerprinting. These fields are not used and show up in memory profiles of the c2c/kv0 roachtest. Release note: None Informs: #93078
- Loading branch information
1 parent
51005e4
commit 260f4fa
Showing
6 changed files
with
79 additions
and
28 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
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