Skip to content

Commit

Permalink
fix(log-store): fix incorrect lag caused by invalid initial read epoch (
Browse files Browse the repository at this point in the history
  • Loading branch information
wenym1 authored Aug 26, 2024
1 parent b36ac57 commit b0e50b4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/stream/src/executor/monitor/streaming_stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use risingwave_common::metrics::{
RelabeledGuardedHistogramVec, RelabeledGuardedIntCounterVec,
};
use risingwave_common::monitor::GLOBAL_METRICS_REGISTRY;
use risingwave_common::util::epoch::Epoch;
use risingwave_common::{
register_guarded_gauge_vec_with_registry, register_guarded_histogram_vec_with_registry,
register_guarded_int_counter_vec_with_registry, register_guarded_int_gauge_vec_with_registry,
Expand Down Expand Up @@ -1256,6 +1257,11 @@ impl StreamingMetrics {
.log_store_first_write_epoch
.with_guarded_label_values(&label_list);

let initial_epoch = Epoch::now().0;
log_store_latest_read_epoch.set(initial_epoch as _);
log_store_first_write_epoch.set(initial_epoch as _);
log_store_latest_write_epoch.set(initial_epoch as _);

let log_store_write_rows = self
.log_store_write_rows
.with_guarded_label_values(&label_list);
Expand Down

0 comments on commit b0e50b4

Please sign in to comment.