|
@@ -87,9 +87,22 @@ private:
|
|
|
if (clockClusterTag != InvalidCellTag) {
|
|
|
req->set_clock_cluster_tag(ToProto<int>(clockClusterTag));
|
|
|
}
|
|
|
- return req->Invoke().Apply(BIND([] (const TTimestampServiceProxy::TRspGenerateTimestampsPtr& rsp) {
|
|
|
- return static_cast<TTimestamp>(rsp->timestamp());
|
|
|
- }));
|
|
|
+ return req->Invoke().Apply(
|
|
|
+ BIND([clockClusterTag] (const TTimestampServiceProxy::TRspGenerateTimestampsPtr& rsp) {
|
|
|
+ auto responseClockClusterTag = rsp->has_clock_cluster_tag()
|
|
|
+ ? FromProto<TCellTag>(rsp->clock_cluster_tag())
|
|
|
+ : InvalidCellTag;
|
|
|
+
|
|
|
+ if (clockClusterTag != InvalidCellTag && responseClockClusterTag != InvalidCellTag &&
|
|
|
+ clockClusterTag != responseClockClusterTag)
|
|
|
+ {
|
|
|
+ THROW_ERROR_EXCEPTION(NRpc::EErrorCode::ClockClusterTagMismatch, "Clock cluster tag mismatch")
|
|
|
+ << TErrorAttribute("request_clock_cluster_tag", clockClusterTag)
|
|
|
+ << TErrorAttribute("response_clock_cluster_tag", responseClockClusterTag);
|
|
|
+ }
|
|
|
+
|
|
|
+ return static_cast<TTimestamp>(rsp->timestamp());
|
|
|
+ }));
|
|
|
}
|
|
|
};
|
|
|
|