the master now detects slave chart refreshes and syncs chart clock; fixes #3966
Costa Tsaousis (ktsaou) committed
Jul 18, 2018 at 18:23 UTC
3df3231ad75a1ec258df76c1df28a2c1dcaac8e0
2 files changed
+3
-2
src/rrd.h
+1
@@ -247,6 +247,7 @@ typedef enum rrdset_flags {
247
#define rrdset_flag_set(st, flag) (st)->flags |= (flag)
248
#define rrdset_flag_clear(st, flag) (st)->flags &= ~(flag)
249
#endif
250
+#define rrdset_flag_check_noatomic(st, flag) ((st)->flags & (flag))
251
252
struct rrdset {
253
// ------------------------------------------------------------------------
src/rrdset.c
+2
-2
@@ -718,7 +718,7 @@ RRDSET *rrdset_create_custom(
718
// RRDSET - data collection iteration control
719
720
inline void rrdset_next_usec_unfiltered(RRDSET *st, usec_t microseconds) {
721
- if(unlikely(!st->last_collected_time.tv_sec || !microseconds)) {
721
+ if(unlikely(!st->last_collected_time.tv_sec || !microseconds || (rrdset_flag_check_noatomic(st, RRDSET_FLAG_SYNC_CLOCK)))) {
722
// call the full next_usec() function
723
rrdset_next_usec(st, microseconds);
724
return;
@@ -736,7 +736,7 @@ inline void rrdset_next_usec(RRDSET *st, usec_t microseconds) {
736
usec_t discarded = microseconds;
737
#endif
738
739
- if(unlikely(rrdset_flag_check(st, RRDSET_FLAG_SYNC_CLOCK))) {
739
+ if(unlikely(rrdset_flag_check_noatomic(st, RRDSET_FLAG_SYNC_CLOCK))) {
740
// the chart needs to be re-synced to current time
741
rrdset_flag_clear(st, RRDSET_FLAG_SYNC_CLOCK);
742