Skip to content

Commit

Permalink
comapction: use "sql-row-spill" for disk spill compactions
Browse files Browse the repository at this point in the history
Use the `sql-row-spill` write category for both flushes and
compactions of stores used for SQL disk spilling.
  • Loading branch information
RaduBerinde committed May 1, 2024
1 parent 6e82cc3 commit 426803e
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions compaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -3011,20 +3011,22 @@ func (d *DB) newCompactionOutput(
d.mu.Unlock()

var writeCategory vfs.DiskWriteCategory
if d.opts.EnableSQLRowSpillMetrics {
// In the scenario that the Pebble engine is used for SQL row spills the
// data written to the memtable will correspond to spills to disk and
// should be categorized as such.
writeCategory = "sql-row-spill"
} else if c.kind == compactionKindFlush {
writeCategory = "pebble-memtable-flush"
} else {
writeCategory = "pebble-compaction"
}

var reason string
if c.kind == compactionKindFlush {
reason = "flushing"
if d.opts.EnableSQLRowSpillMetrics {
// In the scenario that the Pebble engine is used for SQL row spills the
// data written to the memtable will correspond to spills to disk and
// should be categorized as such.
writeCategory = "sql-row-spill"
} else {
writeCategory = "pebble-memtable-flush"
}
} else {
reason = "compacting"
writeCategory = "pebble-compaction"
}

ctx := context.TODO()
Expand Down

0 comments on commit 426803e

Please sign in to comment.