Skip to content

during rename, we delete old key and create a new one in parallel, which affects transaction atomicity #5296

Open
@BorysTheDev

Description

@BorysTheDev

we run next cb in parallel on 2 shards

void Renamer::FinalizeRename() {
  auto cb = [this](Transaction* t, EngineShard* shard) {
    const ShardId shard_id = shard->shard_id();

    if (!do_copy_ && shard_id == src_sid_) {
      return DelSrc(t, shard);
    }

    if (shard_id == dest_sid_) {
      return DeserializeDest(t, shard);
    }

    return OpStatus::OK;
  };

  transaction_->Execute(std::move(cb), true);
}

Consider next flow

DelSrc() -> success
DeserializeDest(t, shard); -> ERROR
but the source is already deleted, so we lost the data

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions