mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-24 18:50:49 +00:00
Remove strange fsync on coordination logs rotation
This commit is contained in:
parent
ad85467128
commit
a40209e84d
@ -357,10 +357,6 @@ void Changelog::readChangelogAndInitWriter(size_t last_commited_log_index, size_
|
|||||||
|
|
||||||
void Changelog::rotate(size_t new_start_log_index)
|
void Changelog::rotate(size_t new_start_log_index)
|
||||||
{
|
{
|
||||||
//// doesn't exist on init
|
|
||||||
if (current_writer)
|
|
||||||
current_writer->flush();
|
|
||||||
|
|
||||||
ChangelogFileDescription new_description;
|
ChangelogFileDescription new_description;
|
||||||
new_description.prefix = DEFAULT_PREFIX;
|
new_description.prefix = DEFAULT_PREFIX;
|
||||||
new_description.from_log_index = new_start_log_index;
|
new_description.from_log_index = new_start_log_index;
|
||||||
|
@ -192,15 +192,15 @@ bool KeeperServer::isLeaderAlive() const
|
|||||||
|
|
||||||
nuraft::cb_func::ReturnCode KeeperServer::callbackFunc(nuraft::cb_func::Type type, nuraft::cb_func::Param * /* param */)
|
nuraft::cb_func::ReturnCode KeeperServer::callbackFunc(nuraft::cb_func::Type type, nuraft::cb_func::Param * /* param */)
|
||||||
{
|
{
|
||||||
|
if (initialized_flag)
|
||||||
|
return nuraft::cb_func::ReturnCode::Ok;
|
||||||
|
|
||||||
size_t last_commited = state_machine->last_commit_index();
|
size_t last_commited = state_machine->last_commit_index();
|
||||||
size_t next_index = state_manager->getLogStore()->next_slot();
|
size_t next_index = state_manager->getLogStore()->next_slot();
|
||||||
bool commited_store = false;
|
bool commited_store = false;
|
||||||
if (next_index < last_commited || next_index - last_commited <= 1)
|
if (next_index < last_commited || next_index - last_commited <= 1)
|
||||||
commited_store = true;
|
commited_store = true;
|
||||||
|
|
||||||
if (initialized_flag)
|
|
||||||
return nuraft::cb_func::ReturnCode::Ok;
|
|
||||||
|
|
||||||
auto set_initialized = [this] ()
|
auto set_initialized = [this] ()
|
||||||
{
|
{
|
||||||
std::unique_lock lock(initialized_mutex);
|
std::unique_lock lock(initialized_mutex);
|
||||||
|
Loading…
Reference in New Issue
Block a user