diff options
author | alexnick <alexnick@ydb.tech> | 2023-08-04 13:30:10 +0300 |
---|---|---|
committer | alexnick <alexnick@ydb.tech> | 2023-08-04 14:57:52 +0300 |
commit | 4584e5138ee3afcaacfa2dfe5d619314caeb026b (patch) | |
tree | f630a3083f703ed969b0f09c093e7c49ea1e1d4c | |
parent | 01ca4df3ffce38d467ddefc9ba58937f7dc9a6ac (diff) | |
download | ydb-4584e5138ee3afcaacfa2dfe5d619314caeb026b.tar.gz |
fix for different clocks on hosts (getRecords)
update
-rw-r--r-- | ydb/services/datastreams/datastreams_proxy.cpp | 3 | ||||
-rw-r--r-- | ydb/services/datastreams/shard_iterator.h | 6 |
2 files changed, 4 insertions, 5 deletions
diff --git a/ydb/services/datastreams/datastreams_proxy.cpp b/ydb/services/datastreams/datastreams_proxy.cpp index 108130d52b3..cf0b456e8db 100644 --- a/ydb/services/datastreams/datastreams_proxy.cpp +++ b/ydb/services/datastreams/datastreams_proxy.cpp @@ -33,9 +33,6 @@ namespace NKikimr::NDataStreams::V1 { const i32 DEFAULT_STREAM_DAY_RETENTION = TDuration::Days(1).Hours(); const i32 DEFAULT_STREAM_WEEK_RETENTION = TDuration::Days(7).Hours(); - const i64 TIMESTAMP_DELTA_ALLOWED_MS = 10'000; - - using namespace NGRpcService; using namespace NGRpcProxy::V1; diff --git a/ydb/services/datastreams/shard_iterator.h b/ydb/services/datastreams/shard_iterator.h index 41b50142684..c82a53ec839 100644 --- a/ydb/services/datastreams/shard_iterator.h +++ b/ydb/services/datastreams/shard_iterator.h @@ -7,6 +7,8 @@ namespace NKikimr::NDataStreams::V1 { +const i64 TIMESTAMP_DELTA_ALLOWED_MS = 10'000; + class TShardIterator { using TPartitionOffset = std::invoke_result_t<decltype(&NKikimrClient::TCmdReadResult_TResult::GetOffset), @@ -25,7 +27,7 @@ using TYdsTimestamp = NKikimrPQ::TYdsShardIterator>; static_assert(std::is_same<TCreationTimestamp, TYdsTimestamp>::value, "Types of partition message creation timestamp and yds record timestamp should match"); - + public: static constexpr ui64 LIFETIME_MS = TDuration::Minutes(5).MilliSeconds(); @@ -111,7 +113,7 @@ void SetSequenceNumber(ui64 seqno) { } bool IsAlive(ui64 now) const { - return now >= Proto.GetCreationTimestampMs() && now - + return now + TIMESTAMP_DELTA_ALLOWED_MS >= Proto.GetCreationTimestampMs() && now - Proto.GetCreationTimestampMs() < LIFETIME_MS; } |