diff --git a/docs/generated/settings/settings.html b/docs/generated/settings/settings.html
index 1781b53e66b4..e910fcaf7ae0 100644
--- a/docs/generated/settings/settings.html
+++ b/docs/generated/settings/settings.html
@@ -264,6 +264,7 @@
sql.txn.read_committed_isolation.enabled
| boolean | false | set to true to allow transactions to use the READ COMMITTED isolation level if specified by BEGIN/SET commands | Serverless/Dedicated/Self-Hosted |
sql.txn_fingerprint_id_cache.capacity
| integer | 100 | the maximum number of txn fingerprint IDs stored | Serverless/Dedicated/Self-Hosted |
storage.experimental.eventually_file_only_snapshots.enabled
| boolean | false | set to true to use eventually-file-only-snapshots even when kv.snapshot_receiver.excise.enabled is false | Dedicated/Self-Hosted |
+storage.ingest_split.enabled
| boolean | false | set to true to use ingest-time splitting to lower write-amplification (experimental) | Dedicated/Self-Hosted |
storage.max_sync_duration
| duration | 20s | maximum duration for disk operations; any operations that take longer than this setting trigger a warning log entry or process crash | Serverless/Dedicated/Self-Hosted (read-only) |
storage.max_sync_duration.fatal.enabled
| boolean | true | if true, fatal the process when a disk operation exceeds storage.max_sync_duration | Serverless/Dedicated/Self-Hosted |
storage.value_blocks.enabled
| boolean | true | set to true to enable writing of value blocks in sstables | Serverless/Dedicated/Self-Hosted |
diff --git a/pkg/storage/pebble.go b/pkg/storage/pebble.go
index dbe4a3fd4d24..c25682630b15 100644
--- a/pkg/storage/pebble.go
+++ b/pkg/storage/pebble.go
@@ -135,6 +135,21 @@ var UseExciseForSnapshots = settings.RegisterBoolSetting(
settings.WithPublic,
)
+// IngestSplitEnabled controls whether ingest-time splitting is enabled in
+// Pebble. This feature allows for existing sstables to be split into multiple
+// virtual sstables at ingest time if that allows for an ingestion sstable to go
+// into a lower level than it would otherwise be in. No keys are masked with
+// this split; it only happens if there are no keys in that existing sstable
+// in the span of the incoming sstable.
+var IngestSplitEnabled = settings.RegisterBoolSetting(
+ settings.SystemOnly,
+ "storage.ingest_split.enabled",
+ "set to true to use ingest-time splitting to lower write-amplification (experimental)",
+ util.ConstantWithMetamorphicTestBool(
+ "storage.ingest_split.enabled", false), /* defaultValue */
+ settings.WithPublic,
+)
+
// IngestAsFlushable controls whether ingested sstables that overlap the
// memtable may be lazily ingested: written to the WAL and enqueued in the list
// of flushables (eg, memtables, large batches and now lazily-ingested
@@ -1094,6 +1109,9 @@ func NewPebble(ctx context.Context, cfg PebbleConfig) (p *Pebble, err error) {
// See https://github.com/cockroachdb/pebble/issues/3120
// TODO(travers): Re-enable, once the issues are resolved.
opts.Experimental.MultiLevelCompactionHeuristic = pebble.NoMultiLevel{}
+ opts.Experimental.IngestSplit = func() bool {
+ return IngestSplitEnabled.Get(&cfg.Settings.SV)
+ }
auxDir := opts.FS.PathJoin(cfg.Dir, base.AuxiliaryDir)
if err := opts.FS.MkdirAll(auxDir, 0755); err != nil {