lib/{mergeset,storage}: make it clear that DebugFlush() doesn't store all the recently ingested data to disk

DebugFlush() makes sure that the recently ingested data becomes visible to search.

Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4272
This commit is contained in:
Aliaksandr Valialkin 2023-05-16 11:50:15 -07:00
parent 664db964ca
commit 09b403d38a
No known key found for this signature in database
GPG key ID: A72BEC6CD3D0DED1
2 changed files with 15 additions and 3 deletions

View file

@ -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)

View file

@ -283,7 +283,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()