diff --git a/lib/mergeset/table.go b/lib/mergeset/table.go index a10ce4a586..4e77f7be8a 100644 --- a/lib/mergeset/table.go +++ b/lib/mergeset/table.go @@ -594,9 +594,14 @@ func (tb *Table) mergePartsOptimal(pws []*partWrapper) error { return nil } -// DebugFlush flushes all the added items to the storage, so they become visible to search. +// DebugFlush makes sure all the recently added data is visible to search. // -// This function is only for debugging and testing. +// Note: this function doesn't store all the in-memory data to disk - it just converts +// recently added items to searchable parts, which can be stored either in memory +// (if they are quite small) or to persistent disk. +// +// This function is for debugging and testing purposes only, +// since it may slow down data ingestion when used frequently. func (tb *Table) DebugFlush() { tb.flushPendingItems(nil, true) diff --git a/lib/storage/storage.go b/lib/storage/storage.go index c7d1bee8f0..e6b2aaba49 100644 --- a/lib/storage/storage.go +++ b/lib/storage/storage.go @@ -298,7 +298,14 @@ func (s *Storage) updateDeletedMetricIDs(metricIDs *uint64set.Set) { s.deletedMetricIDsUpdateLock.Unlock() } -// DebugFlush flushes recently added storage data, so it becomes visible to search. +// DebugFlush makes sure all the recently added data is visible to search. +// +// Note: this function doesn't store all the in-memory data to disk - it just converts +// recently added items to searchable parts, which can be stored either in memory +// (if they are quite small) or to persistent disk. +// +// This function is for debugging and testing purposes only, +// since it may slow down data ingestion when used frequently. func (s *Storage) DebugFlush() { s.tb.flushPendingRows() s.idb().tb.DebugFlush()