Skip to content

storage: use IngestExternalFile instead of WriteBatches for applying snapshots #16954

@petermattis

Description

@petermattis

Sending a snapshot of a range currently involves generating a series of 256KB WriteBatches which are then applied on the recipient. Per the recent work to use the RocksDB IngestExternalFile functionality for restore, it would likely be significantly faster on the recipient to send an sstable instead. Using IngestExternalFile for applying snapshots should be straightforward in comparison to the usage within restore as we don't have any of the complexity of Raft involved. The sender can create the sstable locally and then stream it to the recipient. And because we send a header before streaming the snapshot, we can probe whether the recipient supports receiving an sstable snapshot which will make the migration story easier.

There is no particular urgency here as applying snapshots is not currently a bottleneck.

@danhhz Do you have benchmark numbers readily available showing the performance difference between IngestExternalFile and applying the equivalent WriteBatches?

Metadata

Metadata

Labels

A-kv-distributionRelating to rebalancing and leasing.C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions