diff options
author | kruall <kruall@ydb.tech> | 2022-07-15 17:42:44 +0300 |
---|---|---|
committer | kruall <kruall@ydb.tech> | 2022-07-15 17:42:44 +0300 |
commit | 21015da3e1437a6335a8f876b0ebca4a302917d2 (patch) | |
tree | 10950bb1ef4e9cdd134cf5fc2b24cc647b055426 | |
parent | a968df509e4c63cede6d1c98ccaed1f1d32549cc (diff) | |
download | ydb-21015da3e1437a6335a8f876b0ebca4a302917d2.tar.gz |
Fix generation errors,
-rw-r--r-- | ydb/core/keyvalue/keyvalue_state.cpp | 2 | ||||
-rw-r--r-- | ydb/core/keyvalue/keyvalue_state.h | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/ydb/core/keyvalue/keyvalue_state.cpp b/ydb/core/keyvalue/keyvalue_state.cpp index 997fd31d1bc..f87dea8d924 100644 --- a/ydb/core/keyvalue/keyvalue_state.cpp +++ b/ydb/core/keyvalue/keyvalue_state.cpp @@ -2814,7 +2814,7 @@ bool TKeyValueState::PrepareAcquireLockRequest(const TActorContext &ctx, TEvKeyV StoredState.SetChannelGeneration(ExecutorGeneration); StoredState.SetChannelStep(NextLogoBlobStep - 1); - TRequestType::EType requestType = TRequestType::ReadOnly; + TRequestType::EType requestType = TRequestType::ReadOnlyInline; intermediate.Reset(new TIntermediate(ev->Sender, ctx.SelfID, StoredState.GetChannelGeneration(), StoredState.GetChannelStep(), requestType)); diff --git a/ydb/core/keyvalue/keyvalue_state.h b/ydb/core/keyvalue/keyvalue_state.h index 2c3b0e431f6..51f5b3ed080 100644 --- a/ydb/core/keyvalue/keyvalue_state.h +++ b/ydb/core/keyvalue/keyvalue_state.h @@ -503,9 +503,9 @@ public: THolder<TIntermediate> &intermediate) { auto &record = kvRequest->Record; - intermediate->HasGeneration = true; - intermediate->Generation = record.lock_generation(); if (record.has_lock_generation() && record.lock_generation() != StoredState.GetUserGeneration()) { + intermediate->HasGeneration = true; + intermediate->Generation = record.lock_generation(); TStringStream str; str << "KeyValue# " << TabletId; str << " Generation mismatch! Requested# " << record.lock_generation(); @@ -514,6 +514,8 @@ public: ReplyError<typename TGrpcRequestWithLockGeneration::TResponse>(ctx, str.Str(), NKikimrKeyValue::Statuses::RSTATUS_WRONG_LOCK_GENERATION, intermediate); return true; + } else { + intermediate->HasGeneration = false; } return false; } |