diff options
author | kruall <kruall@ydb.tech> | 2023-08-25 17:25:42 +0300 |
---|---|---|
committer | kruall <kruall@ydb.tech> | 2023-08-25 18:01:58 +0300 |
commit | 35eaba5865b71c2058f274a0a126162c7a29b978 (patch) | |
tree | efd9468cc5bb25fe33d84c894cb1676f32b65b05 | |
parent | 8914eec08242396594eec71ba481be1f1a812997 (diff) | |
download | ydb-35eaba5865b71c2058f274a0a126162c7a29b978.tar.gz |
Set hasGaneration in case generation correct, KIKIMR-18954
-rw-r--r-- | ydb/core/keyvalue/keyvalue_state.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/ydb/core/keyvalue/keyvalue_state.h b/ydb/core/keyvalue/keyvalue_state.h index 2f1afd766d..1e52702512 100644 --- a/ydb/core/keyvalue/keyvalue_state.h +++ b/ydb/core/keyvalue/keyvalue_state.h @@ -503,17 +503,19 @@ public: THolder<TIntermediate> &intermediate) { auto &record = kvRequest->Record; - if (record.has_lock_generation() && record.lock_generation() != StoredState.GetUserGeneration()) { + if (record.has_lock_generation()) { intermediate->HasGeneration = true; intermediate->Generation = record.lock_generation(); - TStringStream str; - str << "KeyValue# " << TabletId; - str << " Generation mismatch! Requested# " << record.lock_generation(); - str << " Actual# " << StoredState.GetUserGeneration(); - str << " Marker# KV05"; - ReplyError<typename TGrpcRequestWithLockGeneration::TResponse>(ctx, str.Str(), - NKikimrKeyValue::Statuses::RSTATUS_WRONG_LOCK_GENERATION, intermediate); - return true; + if (record.lock_generation() != StoredState.GetUserGeneration()) { + TStringStream str; + str << "KeyValue# " << TabletId; + str << " Generation mismatch! Requested# " << record.lock_generation(); + str << " Actual# " << StoredState.GetUserGeneration(); + str << " Marker# KV05"; + ReplyError<typename TGrpcRequestWithLockGeneration::TResponse>(ctx, str.Str(), + NKikimrKeyValue::Statuses::RSTATUS_WRONG_LOCK_GENERATION, intermediate); + return true; + } } else { intermediate->HasGeneration = false; } |