@@ -319,8 +319,7 @@ class PikaServer : public pstd::noncopyable {
319319 bool SlotsMigrateBatch (const std::string &ip, int64_t port, int64_t time_out, int64_t slots, int64_t keys_num, const std::shared_ptr<DB>& db);
320320 void GetSlotsMgrtSenderStatus (std::string *ip, int64_t * port, int64_t *slot, bool *migrating, int64_t *moved, int64_t *remained);
321321 bool SlotsMigrateAsyncCancel ();
322- std::shared_mutex bgsave_protector_;
323- BgSaveInfo bgsave_info_;
322+ std::shared_mutex bgslots_protector_;
324323
325324 /*
326325 * BGSlotsReload used
@@ -346,28 +345,28 @@ class PikaServer : public pstd::noncopyable {
346345 BGSlotsReload bgslots_reload_;
347346
348347 BGSlotsReload bgslots_reload () {
349- std::lock_guard ml (bgsave_protector_ );
348+ std::lock_guard ml (bgslots_protector_ );
350349 return bgslots_reload_;
351350 }
352351 bool GetSlotsreloading () {
353- std::lock_guard ml (bgsave_protector_ );
352+ std::lock_guard ml (bgslots_protector_ );
354353 return bgslots_reload_.reloading ;
355354 }
356355 void SetSlotsreloading (bool reloading) {
357- std::lock_guard ml (bgsave_protector_ );
356+ std::lock_guard ml (bgslots_protector_ );
358357 bgslots_reload_.reloading = reloading;
359358 }
360359 void SetSlotsreloadingCursor (int64_t cursor) {
361- std::lock_guard ml (bgsave_protector_ );
360+ std::lock_guard ml (bgslots_protector_ );
362361 bgslots_reload_.cursor = cursor;
363362 }
364363 int64_t GetSlotsreloadingCursor () {
365- std::lock_guard ml (bgsave_protector_ );
364+ std::lock_guard ml (bgslots_protector_ );
366365 return bgslots_reload_.cursor ;
367366 }
368367
369368 void SetSlotsreloadingEndTime () {
370- std::lock_guard ml (bgsave_protector_ );
369+ std::lock_guard ml (bgslots_protector_ );
371370 bgslots_reload_.end_time = time (nullptr );
372371 }
373372 void Bgslotsreload (const std::shared_ptr<DB>& db);
@@ -408,33 +407,33 @@ class PikaServer : public pstd::noncopyable {
408407 net::BGThread bgslots_cleanup_thread_;
409408
410409 BGSlotsCleanup bgslots_cleanup () {
411- std::lock_guard ml (bgsave_protector_ );
410+ std::lock_guard ml (bgslots_protector_ );
412411 return bgslots_cleanup_;
413412 }
414413 bool GetSlotscleaningup () {
415- std::lock_guard ml (bgsave_protector_ );
414+ std::lock_guard ml (bgslots_protector_ );
416415 return bgslots_cleanup_.cleaningup ;
417416 }
418417 void SetSlotscleaningup (bool cleaningup) {
419- std::lock_guard ml (bgsave_protector_ );
418+ std::lock_guard ml (bgslots_protector_ );
420419 bgslots_cleanup_.cleaningup = cleaningup;
421420 }
422421 void SetSlotscleaningupCursor (int64_t cursor) {
423- std::lock_guard ml (bgsave_protector_ );
422+ std::lock_guard ml (bgslots_protector_ );
424423 bgslots_cleanup_.cursor = cursor;
425424 }
426425 void SetCleanupSlots (std::vector<int > cleanup_slots) {
427- std::lock_guard ml (bgsave_protector_ );
426+ std::lock_guard ml (bgslots_protector_ );
428427 bgslots_cleanup_.cleanup_slots .swap (cleanup_slots);
429428 }
430429 std::vector<int > GetCleanupSlots () {
431- std::lock_guard ml (bgsave_protector_ );
430+ std::lock_guard ml (bgslots_protector_ );
432431 return bgslots_cleanup_.cleanup_slots ;
433432 }
434433
435434 void Bgslotscleanup (std::vector<int > cleanup_slots, const std::shared_ptr<DB>& db);
436435 void StopBgslotscleanup () {
437- std::lock_guard ml (bgsave_protector_ );
436+ std::lock_guard ml (bgslots_protector_ );
438437 bgslots_cleanup_.cleaningup = false ;
439438 std::vector<int > cleanup_slots;
440439 bgslots_cleanup_.cleanup_slots .swap (cleanup_slots);
0 commit comments