lib/mergeset: remove superflouos logging when opening and closing the Table

The logged messages had little useful info, while they were polluting log output during VictoriaMetrics start/stop
This commit is contained in:
Aliaksandr Valialkin 2023-05-16 15:01:22 -07:00
parent 3cbc0975f6
commit d330c7e6fc
No known key found for this signature in database
GPG Key ID: A72BEC6CD3D0DED1

View File

@ -324,8 +324,6 @@ func (pw *partWrapper) decRef() {
// The table is created if it doesn't exist yet.
func MustOpenTable(path string, flushCallback func(), prepareBlock PrepareBlockCallback, isReadOnly *uint32) *Table {
path = filepath.Clean(path)
logger.Infof("opening table %q...", path)
startTime := time.Now()
// Create a directory for the table if it doesn't exist yet.
fs.MustMkdirIfNotExist(path)
@ -353,11 +351,6 @@ func MustOpenTable(path string, flushCallback func(), prepareBlock PrepareBlockC
// Wake up a single background merger, so it could start merging parts if needed.
tb.notifyBackgroundMergers()
var m TableMetrics
tb.UpdateMetrics(&m)
logger.Infof("table %q has been opened in %.3f seconds; partsCount: %d; blocksCount: %d, itemsCount: %d; sizeBytes: %d",
path, time.Since(startTime).Seconds(), m.FilePartsCount, m.FileBlocksCount, m.FileItemsCount, m.FileSizeBytes)
if flushCallback != nil {
tb.flushCallbackWorkerWG.Add(1)
go func() {
@ -392,20 +385,11 @@ func (tb *Table) startBackgroundWorkers() {
func (tb *Table) MustClose() {
close(tb.stopCh)
logger.Infof("waiting for background workers to stop on %q...", tb.path)
startTime := time.Now()
// Waiting for background workers to stop
tb.wg.Wait()
logger.Infof("background workers stopped in %.3f seconds on %q", time.Since(startTime).Seconds(), tb.path)
logger.Infof("flushing inmemory parts to files on %q...", tb.path)
startTime = time.Now()
tb.flushInmemoryItems()
logger.Infof("inmemory parts have been successfully flushed to files in %.3f seconds at %q", time.Since(startTime).Seconds(), tb.path)
logger.Infof("waiting for flush callback worker to stop on %q...", tb.path)
startTime = time.Now()
tb.flushCallbackWorkerWG.Wait()
logger.Infof("flush callback worker stopped in %.3f seconds on %q", time.Since(startTime).Seconds(), tb.path)
// Remove references to parts from the tb, so they may be eventually closed after all the searches are done.
tb.partsLock.Lock()