mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 10:25:47 +02:00
chore: Fix memcached flags not updated (#2787)
Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
This commit is contained in:
parent
05084354c7
commit
c8724adddf
4 changed files with 20 additions and 15 deletions
|
@ -830,14 +830,10 @@ bool DbSlice::UpdateExpire(DbIndex db_ind, PrimeIterator it, uint64_t at) {
|
|||
void DbSlice::SetMCFlag(DbIndex db_ind, PrimeKey key, uint32_t flag) {
|
||||
auto& db = *db_arr_[db_ind];
|
||||
if (flag == 0) {
|
||||
if (db.mcflag.Erase(key) == 0) {
|
||||
LOG(ERROR) << "Internal error, inconsistent state, mcflag should be present but not found "
|
||||
<< key.ToString();
|
||||
}
|
||||
db.mcflag.Erase(key);
|
||||
} else {
|
||||
auto [it, inserted] = db.mcflag.Insert(std::move(key), flag);
|
||||
if (!inserted)
|
||||
it->second = flag;
|
||||
auto [it, _] = db.mcflag.Insert(std::move(key), flag);
|
||||
it->second = flag;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue