mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 00:22:29 +00:00
Fix concurrent snapshot read/write
This commit is contained in:
parent
833f48751a
commit
f2a8b5b2c6
2
contrib/NuRaft
vendored
2
contrib/NuRaft
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 377f8e77491d9f66ce8e32e88aae19dffe8dc4d7
|
Subproject commit 95d6bbba579b3a4e4c2dede954f541ff6f3dba51
|
@ -267,12 +267,15 @@ int KeeperStateMachine::read_logical_snp_obj(
|
|||||||
{
|
{
|
||||||
std::lock_guard lock(snapshots_lock);
|
std::lock_guard lock(snapshots_lock);
|
||||||
if (s.get_last_log_idx() != latest_snapshot_meta->get_last_log_idx())
|
if (s.get_last_log_idx() != latest_snapshot_meta->get_last_log_idx())
|
||||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "Required to apply snapshot with last log index {}, but our last log index is {}",
|
{
|
||||||
|
LOG_WARNING(log, "Required to apply snapshot with last log index {}, but our last log index is {}. Will ignore this one and retry",
|
||||||
s.get_last_log_idx(), latest_snapshot_meta->get_last_log_idx());
|
s.get_last_log_idx(), latest_snapshot_meta->get_last_log_idx());
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
data_out = nuraft::buffer::clone(*latest_snapshot_buf);
|
data_out = nuraft::buffer::clone(*latest_snapshot_buf);
|
||||||
is_last_obj = true;
|
is_last_obj = true;
|
||||||
}
|
}
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeeperStateMachine::processReadRequest(const KeeperStorage::RequestForSession & request_for_session)
|
void KeeperStateMachine::processReadRequest(const KeeperStorage::RequestForSession & request_for_session)
|
||||||
|
Loading…
Reference in New Issue
Block a user