fix(nodestore): mark the rewritten RotationPhase members maybe_unused

This branch replaced the char const* stage with an owned string and added
cache_. All three members are read only inside the metric macro, so the
telemetry-off build needs the attribute here as well. Without it the merge
from pratik/otel-sync-diagnostics keeps this side of the rewritten lines and
drops the fix.
This commit is contained in:
Pratik Mankawde
2026-09-17 13:45:18 +01:00
parent 195e4e5d53
commit 06db0173db

View File

@@ -263,13 +263,15 @@ private:
}
private:
SHAMapStoreImp& owner_;
// The three below are read only inside the metric macro in the
// destructor, so a -DXRPL_ENABLE_TELEMETRY=0 build sees no use at all.
[[maybe_unused]] SHAMapStoreImp& owner_;
// Owned copies: the constructor takes views so callers can pass the
// label constants, but a view stored in a member would only be valid
// as long as the caller's text was. A phase is built a handful of
// times per rotation, so two small strings cost nothing.
std::string const stage_;
std::string const cache_;
[[maybe_unused]] std::string const stage_;
[[maybe_unused]] std::string const cache_;
std::chrono::steady_clock::time_point start_ = std::chrono::steady_clock::now();
telemetry::ScopedSpanGuard span_;
};