summaryrefslogtreecommitdiffstats
path: root/web/api/queries/query.c
diff options
context:
space:
mode:
authorAdrien BĂ©raud <adrien.beraud@savoirfairelinux.com>2022-05-03 04:34:15 -0400
committerGitHub <noreply@github.com>2022-05-03 11:34:15 +0300
commitd92890b5f180f13b5f680b3bd345e3674b8f8e8c (patch)
tree1ec4ccc7b409e2bdb2fe12fdbb6954470a75e3f5 /web/api/queries/query.c
parent5850810715a9b2fc9413a2b43ae2dc1d1a5b4bf6 (diff)
Configurable storage engine for Netdata agents: step 1 (#12776)
* rrd: move API structures out of rrddim_volatile In C, unlike C++, it's not possible to reference a nested structure from outside this structure. Since we later want to use rrddim_query_ops and rrddim_collect_ops separately from rrddim_volatile, move these nested structures out. * rrd: use opaque handle types for different memory modes
Diffstat (limited to 'web/api/queries/query.c')
-rw-r--r--web/api/queries/query.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/web/api/queries/query.c b/web/api/queries/query.c
index 9308d10bf5..0190a6cfb6 100644
--- a/web/api/queries/query.c
+++ b/web/api/queries/query.c
@@ -580,9 +580,10 @@ static inline void do_dimension_fixedstep(
// read the value from the database
//storage_number n = rd->values[slot];
#ifdef NETDATA_INTERNAL_CHECKS
+ struct mem_query_handle* mem_handle = (struct mem_query_handle*)handle.handle;
if ((rd->rrd_memory_mode != RRD_MEMORY_MODE_DBENGINE) &&
- (rrdset_time2slot(st, now) != (long unsigned)handle.slotted.slot)) {
- error("INTERNAL CHECK: Unaligned query for %s, database slot: %lu, expected slot: %lu", rd->id, (long unsigned)handle.slotted.slot, rrdset_time2slot(st, now));
+ (rrdset_time2slot(st, now) != (long unsigned)(mem_handle->slot))) {
+ error("INTERNAL CHECK: Unaligned query for %s, database slot: %lu, expected slot: %lu", rd->id, (long unsigned)mem_handle->slot, rrdset_time2slot(st, now));
}
#endif
db_now = now; // this is needed to set db_now in case the next_metric implementation does not set it
@@ -601,8 +602,9 @@ static inline void do_dimension_fixedstep(
calculated_number value = NAN;
if(likely(now >= db_now && does_storage_number_exist(n))) {
#if defined(NETDATA_INTERNAL_CHECKS) && defined(ENABLE_DBENGINE)
- if ((rd->rrd_memory_mode == RRD_MEMORY_MODE_DBENGINE) && (now != handle.rrdeng.now)) {
- error("INTERNAL CHECK: Unaligned query for %s, database time: %ld, expected time: %ld", rd->id, (long)handle.rrdeng.now, (long)now);
+ struct rrdeng_query_handle* rrd_handle = (struct rrdeng_query_handle*)handle.handle;
+ if ((rd->rrd_memory_mode == RRD_MEMORY_MODE_DBENGINE) && (now != rrd_handle->now)) {
+ error("INTERNAL CHECK: Unaligned query for %s, database time: %ld, expected time: %ld", rd->id, (long)rrd_handle->now, (long)now);
}
#endif
if (options & RRDR_OPTION_ANOMALY_BIT)