mirror of
https://github.com/prometheus/prometheus.git
synced 2026-02-03 20:39:32 -05:00
Merge 0f146300e6 into 7769495a4a
This commit is contained in:
commit
82a50178aa
1 changed files with 18 additions and 3 deletions
|
|
@ -39,6 +39,12 @@ import (
|
|||
"github.com/prometheus/prometheus/tsdb/tombstones"
|
||||
)
|
||||
|
||||
var warnV1Once sync.Once
|
||||
|
||||
func chunkDir(dir string) string {
|
||||
return filepath.Join(dir, "chunks")
|
||||
}
|
||||
|
||||
// IndexWriter serializes the index for a block of series data.
|
||||
// The methods must be called in the order they are specified in.
|
||||
type IndexWriter interface {
|
||||
|
|
@ -254,18 +260,27 @@ const (
|
|||
CompactionHintFromStaleSeries = "from-stale-series"
|
||||
)
|
||||
|
||||
func chunkDir(dir string) string { return filepath.Join(dir, "chunks") }
|
||||
|
||||
func readMetaFile(dir string) (*BlockMeta, int64, error) {
|
||||
|
||||
b, err := os.ReadFile(filepath.Join(dir, metaFilename))
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
var m BlockMeta
|
||||
|
||||
var m BlockMeta
|
||||
if err := json.Unmarshal(b, &m); err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
|
||||
// ✅ Warning ONLY when V1 is used
|
||||
if m.Version == metaVersion1 {
|
||||
warnV1Once.Do(func() {
|
||||
slog.Warn(
|
||||
"TSDB V1 block format is deprecated and will be removed in a future release",
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
if m.Version != metaVersion1 {
|
||||
return nil, 0, fmt.Errorf("unexpected meta file version %d", m.Version)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue