Skip to content

Commit

Permalink
fix: Pika can not exec full-sync when multi slaves connect to the sam…
Browse files Browse the repository at this point in the history
…e master within a short time (OpenAtomFoundation#2746)

* use int64_t instead of int32_t

---------

Co-authored-by: cjh <[email protected]>
  • Loading branch information
2 people authored and brother-jin committed Jun 24, 2024
1 parent 8c9b4d0 commit 56b3f95
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pika_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,8 @@ void PikaServer::TryDBSync(const std::string& ip, int port, const std::string& d
std::string logger_filename = sync_db->Logger()->filename();
if (pstd::IsDir(bgsave_info.path) != 0 ||
!pstd::FileExists(NewFileName(logger_filename, bgsave_info.offset.b_offset.filenum)) ||
top - bgsave_info.offset.b_offset.filenum > kDBSyncMaxGap) {
static_cast<int64_t>(top) - static_cast<int64_t>(bgsave_info.offset.b_offset.filenum) >
static_cast<int64_t>(kDBSyncMaxGap)) {
// Need Bgsave first
db->BgSaveDB();
}
Expand Down

0 comments on commit 56b3f95

Please sign in to comment.