fix: Shard WAL consumer for higher throughput

Entire-Checkpoint: e583b7b11439
This commit is contained in:
2026-03-18 06:32:14 +01:00
parent 50aed595cf
commit bf1a8a174e
3 changed files with 269 additions and 135 deletions

View File

@@ -361,13 +361,11 @@ func DecodeLine(dec *lineprotocol.Decoder,
Value: metric.Value,
Timestamp: time,
}
select {
case WALMessages <- msg:
default:
// WAL channel full — metric is written to memory store but not WAL.
if !SendWALMessage(msg) {
// WAL shard channel full — metric is written to memory store but not WAL.
// Next binary snapshot will capture it.
if dropped := walDropped.Add(1); dropped%10000 == 1 {
cclog.Warnf("[METRICSTORE]> WAL channel full, dropped %d messages (data safe in memory, next snapshot will capture)", dropped)
cclog.Warnf("[METRICSTORE]> WAL shard channel full, dropped %d messages (data safe in memory, next snapshot will capture)", dropped)
}
}
}