Fix tier check (#21248)
Stelios Fragkakis committed
Nov 4, 2025 at 21:25 UTC
121789c0c7fe7f3d4ecb22fbe0e2d67faac1014d
2 files changed
+3
-3
src/database/rrddim.c
+2
-2
@@ -439,7 +439,7 @@ time_t rrddim_last_entry_s_of_tier(RRDDIM *rd, size_t tier) {
439
if(unlikely(!rd))
440
return 0;
441
442
- if(unlikely(tier > nd_profile.storage_tiers || !rd->tiers[tier].smh))
442
+ if(unlikely(tier >= nd_profile.storage_tiers || !rd->tiers[tier].smh))
443
return 0;
444
445
return storage_engine_latest_time_s(rd->tiers[tier].seb, rd->tiers[tier].smh);
@@ -467,7 +467,7 @@ time_t rrddim_first_entry_s_of_tier(RRDDIM *rd, size_t tier) {
467
if(unlikely(!rd))
468
return 0;
469
470
- if(unlikely(tier > nd_profile.storage_tiers || !rd->tiers[tier].smh))
470
+ if(unlikely(tier >= nd_profile.storage_tiers || !rd->tiers[tier].smh))
471
return 0;
472
473
return storage_engine_oldest_time_s(rd->tiers[tier].seb, rd->tiers[tier].smh);
src/database/rrdset.c
+1
-1
@@ -54,7 +54,7 @@ time_t rrdset_first_entry_s(RRDSET *st) {
54
}
55
56
time_t rrdset_first_entry_s_of_tier(RRDSET *st, size_t tier) {
57
- if(unlikely(tier > nd_profile.storage_tiers))
57
+ if(unlikely(tier >= nd_profile.storage_tiers))
58
return 0;
59
60
RRDDIM *rd;