[CP] [rebuild] fix rebuild fails because of last_submit_pid_ of newly created replica may be invalid

This commit is contained in:
yyy-hust
2023-11-27 13:42:00 +00:00
committed by ob-robot
parent 7c82708e82
commit f3729e4130

View File

@ -236,10 +236,10 @@ public:
} }
bool is_valid() const bool is_valid() const
{ {
return (committed_end_lsn_.is_valid() //last_submit_log_pid_ may be INVALID_PROPOSAL_ID when newly created replica has never synced any log
&& last_submit_lsn_.is_valid() return (committed_end_lsn_.is_valid() && last_submit_lsn_.is_valid());
&& INVALID_PROPOSAL_ID != last_submit_log_pid_);
} }
bool operator==(const RebuildMetaInfo &other) const bool operator==(const RebuildMetaInfo &other) const
{ {
return (committed_end_lsn_ == other.committed_end_lsn_ return (committed_end_lsn_ == other.committed_end_lsn_