mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-02-19 15:30:17 +00:00
Update tsidCache comments, add a comment for testListDirEntrie
Signed-off-by: Artem Fetishev <rtm@victoriametrics.com>
This commit is contained in:
parent
7215d23ab6
commit
2a35999eae
2 changed files with 12 additions and 3 deletions
lib/storage
|
@ -2313,13 +2313,20 @@ func createAllIndexesForMetricName(is *indexSearch, mn *MetricName, tsid *TSID,
|
|||
}
|
||||
|
||||
func (s *Storage) putSeriesToCache(metricNameRaw []byte, genTSID *generationTSID, generation, date uint64) {
|
||||
// Store the TSID for the current indexdb into cache,
|
||||
// so future rows for that TSID are ingested via fast path.
|
||||
// Store the TSID indexdb into cache, so future rows for that TSID are
|
||||
// ingested via fast path.
|
||||
//
|
||||
// With partition index there is no need to store generation in this cache.
|
||||
// We still need to put generation in cache to preserve the cache entry data
|
||||
// format in order address cases when users, once tried partition index,
|
||||
// decided to switch back to legacy monolithic index. Thus, we store 0
|
||||
// generation.
|
||||
genTSID.generation = 0
|
||||
s.putTSIDToCache(genTSID, metricNameRaw)
|
||||
|
||||
// Register the (generation, date, metricID) entry in the cache,
|
||||
// so next time the entry is found there instead of searching for it in the indexdb.
|
||||
// so next time the entry is found there instead of searching for it in the
|
||||
// indexdb.
|
||||
s.dateMetricIDCache.Set(generation, date, genTSID.TSID.MetricID)
|
||||
}
|
||||
|
||||
|
|
|
@ -1662,6 +1662,8 @@ func testCountAllMetricNamesNoExtDB(is *indexSearch, tr TimeRange) int {
|
|||
return len(metricNames)
|
||||
}
|
||||
|
||||
// testListDirEntries returns the all paths inside `root` dir. The `root` dir
|
||||
// itself and paths that start with `ignorePrefix` are omitted.
|
||||
func testListDirEntries(t *testing.T, root string, ignorePrefix ...string) []string {
|
||||
t.Helper()
|
||||
var paths []string
|
||||
|
|
Loading…
Reference in a new issue