txnkv: fix delete temp table issue request to kv-server (#281)

Signed-off-by: lysu <sulifx@gmail.com>
This commit is contained in:
lysu 2021-08-23 19:56:59 +08:00 committed by GitHub
parent 9d2ad5209e
commit 0c8381cbc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -410,8 +410,8 @@ func (c *twoPhaseCommitter) initKeysAndMutations() error {
lockCnt++
} else {
value = it.Value()
if len(value) > 0 {
isUnnecessaryKV := filter != nil && filter.IsUnnecessaryKeyValue(key, value, flags)
if len(value) > 0 {
if isUnnecessaryKV {
if !flags.HasLocked() {
continue
@ -429,6 +429,9 @@ func (c *twoPhaseCommitter) initKeysAndMutations() error {
putCnt++
}
} else {
if isUnnecessaryKV {
continue
}
if !txn.IsPessimistic() && flags.HasPresumeKeyNotExists() {
// delete-your-writes keys in optimistic txn need check not exists in prewrite-phase
// due to `Op_CheckNotExists` doesn't prewrite lock, so mark those keys should not be used in commit-phase.