mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-15 16:30:55 +01:00
lib/{storage,mergeset}: consistency rename: `flushRaw{Rows,Items} -> flushPending{Rows,Items}
This commit is contained in:
parent
233301a549
commit
10a17bfa16
@ -346,7 +346,7 @@ func (tb *Table) MustClose() {
|
|||||||
startTime = time.Now()
|
startTime = time.Now()
|
||||||
|
|
||||||
// Flush raw items the last time before exit.
|
// Flush raw items the last time before exit.
|
||||||
tb.flushRawItems(true)
|
tb.flushPendingItems(true)
|
||||||
|
|
||||||
// Flush inmemory parts to disk.
|
// Flush inmemory parts to disk.
|
||||||
var pws []*partWrapper
|
var pws []*partWrapper
|
||||||
@ -515,7 +515,7 @@ func (tb *Table) rawItemsFlusher() {
|
|||||||
case <-tb.stopCh:
|
case <-tb.stopCh:
|
||||||
return
|
return
|
||||||
case <-ticker.C:
|
case <-ticker.C:
|
||||||
tb.flushRawItems(false)
|
tb.flushPendingItems(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -543,13 +543,13 @@ func (tb *Table) mergePartsOptimal(pws []*partWrapper) error {
|
|||||||
//
|
//
|
||||||
// This function is only for debugging and testing.
|
// This function is only for debugging and testing.
|
||||||
func (tb *Table) DebugFlush() {
|
func (tb *Table) DebugFlush() {
|
||||||
tb.flushRawItems(true)
|
tb.flushPendingItems(true)
|
||||||
|
|
||||||
// Wait for background flushers to finish.
|
// Wait for background flushers to finish.
|
||||||
tb.rawItemsPendingFlushesWG.Wait()
|
tb.rawItemsPendingFlushesWG.Wait()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (tb *Table) flushRawItems(isFinal bool) {
|
func (tb *Table) flushPendingItems(isFinal bool) {
|
||||||
tb.rawItems.flush(tb, isFinal)
|
tb.rawItems.flush(tb, isFinal)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1099,7 +1099,7 @@ func (tb *Table) CreateSnapshotAt(dstDir string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Flush inmemory items to disk.
|
// Flush inmemory items to disk.
|
||||||
tb.flushRawItems(true)
|
tb.flushPendingItems(true)
|
||||||
|
|
||||||
// The snapshot must be created under the lock in order to prevent from
|
// The snapshot must be created under the lock in order to prevent from
|
||||||
// concurrent modifications via runTransaction.
|
// concurrent modifications via runTransaction.
|
||||||
|
@ -649,7 +649,7 @@ func (pt *partition) MustClose() {
|
|||||||
startTime = time.Now()
|
startTime = time.Now()
|
||||||
|
|
||||||
// Flush raw rows the last time before exit.
|
// Flush raw rows the last time before exit.
|
||||||
pt.flushRawRows(true)
|
pt.flushPendingRows(true)
|
||||||
|
|
||||||
// Flush inmemory parts to disk.
|
// Flush inmemory parts to disk.
|
||||||
var pws []*partWrapper
|
var pws []*partWrapper
|
||||||
@ -710,12 +710,12 @@ func (pt *partition) rawRowsFlusher() {
|
|||||||
case <-pt.stopCh:
|
case <-pt.stopCh:
|
||||||
return
|
return
|
||||||
case <-ticker.C:
|
case <-ticker.C:
|
||||||
pt.flushRawRows(false)
|
pt.flushPendingRows(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (pt *partition) flushRawRows(isFinal bool) {
|
func (pt *partition) flushPendingRows(isFinal bool) {
|
||||||
pt.rawRows.flush(pt, isFinal)
|
pt.rawRows.flush(pt, isFinal)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1639,7 +1639,7 @@ func (pt *partition) CreateSnapshotAt(smallPath, bigPath string) error {
|
|||||||
startTime := time.Now()
|
startTime := time.Now()
|
||||||
|
|
||||||
// Flush inmemory data to disk.
|
// Flush inmemory data to disk.
|
||||||
pt.flushRawRows(true)
|
pt.flushPendingRows(true)
|
||||||
if _, err := pt.flushInmemoryParts(nil, true); err != nil {
|
if _, err := pt.flushInmemoryParts(nil, true); err != nil {
|
||||||
return fmt.Errorf("cannot flush inmemory parts: %w", err)
|
return fmt.Errorf("cannot flush inmemory parts: %w", err)
|
||||||
}
|
}
|
||||||
|
@ -185,7 +185,7 @@ func testPartitionSearchEx(t *testing.T, ptt int64, tr TimeRange, partsCount, ma
|
|||||||
pt.AddRows(rows)
|
pt.AddRows(rows)
|
||||||
|
|
||||||
// Flush just added rows to a separate partition.
|
// Flush just added rows to a separate partition.
|
||||||
pt.flushRawRows(true)
|
pt.flushPendingRows(true)
|
||||||
}
|
}
|
||||||
testPartitionSearch(t, pt, tsids, tr, rbsExpected, -1)
|
testPartitionSearch(t, pt, tsids, tr, rbsExpected, -1)
|
||||||
pt.MustClose()
|
pt.MustClose()
|
||||||
|
@ -321,7 +321,7 @@ func (s *Storage) updateDeletedMetricIDs(metricIDs *uint64set.Set) {
|
|||||||
|
|
||||||
// DebugFlush flushes recently added storage data, so it becomes visible to search.
|
// DebugFlush flushes recently added storage data, so it becomes visible to search.
|
||||||
func (s *Storage) DebugFlush() {
|
func (s *Storage) DebugFlush() {
|
||||||
s.tb.flushRawRows()
|
s.tb.flushPendingRows()
|
||||||
s.idb().tb.DebugFlush()
|
s.idb().tb.DebugFlush()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -215,15 +215,15 @@ func (tb *table) MustClose() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// flushRawRows flushes all the pending rows, so they become visible to search.
|
// flushPendingRows flushes all the pending rows, so they become visible to search.
|
||||||
//
|
//
|
||||||
// This function is for debug purposes only.
|
// This function is for debug purposes only.
|
||||||
func (tb *table) flushRawRows() {
|
func (tb *table) flushPendingRows() {
|
||||||
ptws := tb.GetPartitions(nil)
|
ptws := tb.GetPartitions(nil)
|
||||||
defer tb.PutPartitions(ptws)
|
defer tb.PutPartitions(ptws)
|
||||||
|
|
||||||
for _, ptw := range ptws {
|
for _, ptw := range ptws {
|
||||||
ptw.pt.flushRawRows(true)
|
ptw.pt.flushPendingRows(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -197,7 +197,7 @@ func testTableSearchEx(t *testing.T, trData, trSearch TimeRange, partitionsCount
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Flush rows to parts.
|
// Flush rows to parts.
|
||||||
tb.flushRawRows()
|
tb.flushPendingRows()
|
||||||
}
|
}
|
||||||
testTableSearch(t, tb, tsids, trSearch, rbsExpected, -1)
|
testTableSearch(t, tb, tsids, trSearch, rbsExpected, -1)
|
||||||
tb.MustClose()
|
tb.MustClose()
|
||||||
|
Loading…
Reference in New Issue
Block a user