diff --git a/docs/generated/settings/settings-for-tenants.txt b/docs/generated/settings/settings-for-tenants.txt
index 06811321d3f6..bbe69ae53f43 100644
--- a/docs/generated/settings/settings-for-tenants.txt
+++ b/docs/generated/settings/settings-for-tenants.txt
@@ -386,6 +386,7 @@ sql.txn.read_committed_isolation.enabled boolean true set to true to allow trans
sql.txn.repeatable_read_isolation.enabled (alias: sql.txn.snapshot_isolation.enabled) boolean false set to true to allow transactions to use the REPEATABLE READ isolation level if specified by BEGIN/SET commands application
sql.txn_fingerprint_id_cache.capacity integer 100 the maximum number of txn fingerprint IDs stored application
storage.columnar_blocks.enabled boolean false set to true to enable columnar-blocks to store KVs in a columnar format system-visible
+storage.delete_compaction_excise.enabled boolean true set to false to direct Pebble to not partially excise sstables in delete-only compactions system-visible
storage.ingestion.value_blocks.enabled boolean true set to true to enable writing of value blocks in ingestion sstables application
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 system-visible
storage.max_sync_duration.fatal.enabled boolean true if true, fatal the process when a disk operation exceeds storage.max_sync_duration application
diff --git a/docs/generated/settings/settings.html b/docs/generated/settings/settings.html
index 84e79c96fd07..525c0e5e827d 100644
--- a/docs/generated/settings/settings.html
+++ b/docs/generated/settings/settings.html
@@ -340,6 +340,7 @@
sql.txn.repeatable_read_isolation.enabled (alias: sql.txn.snapshot_isolation.enabled)
| boolean | false | set to true to allow transactions to use the REPEATABLE READ 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.columnar_blocks.enabled
| boolean | false | set to true to enable columnar-blocks to store KVs in a columnar format | Dedicated/Self-hosted (read-write); Serverless (read-only) |
+storage.delete_compaction_excise.enabled
| boolean | true | set to false to direct Pebble to not partially excise sstables in delete-only compactions | Dedicated/Self-hosted (read-write); Serverless (read-only) |
storage.experimental.eventually_file_only_snapshots.enabled
| boolean | true | set to false to disable eventually-file-only-snapshots (kv.snapshot_receiver.excise.enabled must also be false) | Dedicated/Self-Hosted |
storage.ingest_split.enabled
| boolean | true | set to false to disable ingest-time splitting that lowers write-amplification | Dedicated/Self-Hosted |
storage.ingestion.value_blocks.enabled
| boolean | true | set to true to enable writing of value blocks in ingestion sstables | Serverless/Dedicated/Self-Hosted |
diff --git a/pkg/storage/pebble.go b/pkg/storage/pebble.go
index d43d536bc8ef..936c03a0862c 100644
--- a/pkg/storage/pebble.go
+++ b/pkg/storage/pebble.go
@@ -111,6 +111,18 @@ var columnarBlocksEnabled = settings.RegisterBoolSetting(
settings.WithPublic,
)
+// deleteCompactionsCanExcise controls whether delete compactions can
+// apply rangedels/rangekeydels on sstables they partially apply to, through
+// an excise operation, instead of just applying the rangedels/rangekeydels
+// that fully delete sstables.
+var deleteCompactionsCanExcise = settings.RegisterBoolSetting(
+ settings.SystemVisible,
+ "storage.delete_compaction_excise.enabled",
+ "set to false to direct Pebble to not partially excise sstables in delete-only compactions",
+ metamorphic.ConstantWithTestBool(
+ "storage.delete_compaction_excise.enabled", true), /* 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
@@ -1228,6 +1240,9 @@ func newPebble(ctx context.Context, cfg engineConfig) (p *Pebble, err error) {
cfg.opts.Experimental.EnableColumnarBlocks = func() bool {
return columnarBlocksEnabled.Get(&cfg.settings.SV)
}
+ cfg.opts.Experimental.EnableDeleteOnlyCompactionExcises = func() bool {
+ return deleteCompactionsCanExcise.Get(&cfg.settings.SV)
+ }
auxDir := cfg.opts.FS.PathJoin(cfg.env.Dir, base.AuxiliaryDir)
if !cfg.env.IsReadOnly() {