Skip to content

Commit

Permalink
fix: fix some build errors on the latest MacOS (#2158)
Browse files Browse the repository at this point in the history
  • Loading branch information
acelyc111 authored Dec 10, 2024
1 parent db13635 commit 2837b17
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/meta/meta_state_service_simple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ void meta_state_service_simple::write_log(blob &&log_blob,
CHECK(log_succeed, "we cannot handle logging failure now");
__err_cb_bind_and_enqueue(task, internal_operation(), 0);
}));
auto continuation_task_ptr = continuation_task.get();
_task_queue.emplace(move(continuation_task));
auto *continuation_task_ptr = continuation_task.get();
_task_queue.emplace(std::move(continuation_task));
_log_lock.unlock();

file::write(_log,
Expand Down Expand Up @@ -525,7 +525,7 @@ task_ptr meta_state_service_simple::get_children(const std::string &node,
result.push_back(child_pair.first);
}
return tasking::enqueue(
cb_code, tracker, [=]() mutable { cb_get_children(ERR_OK, move(result)); });
cb_code, tracker, [=]() mutable { cb_get_children(ERR_OK, result); });
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/meta/meta_state_service_simple.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class meta_state_service_simple : public meta_state_service
{
bool done;
std::function<void(bool)> cb;
operation(bool done, std::function<void(bool)> &&cb) : done(done), cb(move(cb)) {}
operation(bool done, std::function<void(bool)> &&cb) : done(done), cb(std::move(cb)) {}
};

#pragma pack(push, 1)
Expand Down
4 changes: 2 additions & 2 deletions src/meta/test/balancer_validator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ static void check_cure(app_mapper &apps, node_mapper &nodes, ::dsn::partition_co
CHECK(node != nodes.end(), "");
ns = &node->second;
SET_OBJ_IP_AND_HOST_PORT(pc, primary, act, node);
std::remove(pc.secondaries.begin(), pc.secondaries.end(), pc.primary);
std::remove(pc.hp_secondaries.begin(), pc.hp_secondaries.end(), pc.hp_primary);
(void)std::remove(pc.secondaries.begin(), pc.secondaries.end(), pc.primary);
(void)std::remove(pc.hp_secondaries.begin(), pc.hp_secondaries.end(), pc.hp_primary);
CHECK_EQ(ns->served_as(pc.pid), partition_status::PS_SECONDARY);
ns->put_partition(pc.pid, true);
}
Expand Down
5 changes: 2 additions & 3 deletions src/replica/prepare_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,17 +183,16 @@ void prepare_list::commit(decree d, commit_type ct)
return;
}
case COMMIT_ALL_READY: {
if (d != last_committed_decree() + 1)
if (d != last_committed_decree() + 1) {
return;
}

int count = 0;
mutation_ptr mu = get_mutation_by_decree(last_committed_decree() + 1);

while (mu != nullptr && mu->is_ready_for_commit() && mu->data.header.ballot >= last_bt) {
_last_committed_decree++;
last_bt = mu->data.header.ballot;
_committer(mu);
count++;
mu = mutation_cache::get_mutation_by_decree(_last_committed_decree + 1);
}

Expand Down
9 changes: 5 additions & 4 deletions src/test/bench_test/benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,11 @@ void benchmark::write_random(thread_arg *thread)
{
// do write operation num times
uint64_t bytes = 0;
int count = 0;
for (int i = 0; i < FLAGS_benchmark_num; i++) {
// generate hash key and sort key
std::string hashkey, sortkey, value;
std::string hashkey;
std::string sortkey;
std::string value;
generate_kv_pair(hashkey, sortkey, value);

// write to pegasus
Expand All @@ -185,9 +186,9 @@ void benchmark::write_random(thread_arg *thread)
int ret = _client->set(hashkey, sortkey, value, FLAGS_pegasus_timeout_ms);
if (ret == ::pegasus::PERR_OK) {
bytes += FLAGS_value_size + FLAGS_hashkey_size + FLAGS_sortkey_size;
count++;
break;
} else if (ret != ::pegasus::PERR_TIMEOUT || try_count > 3) {
}
if (ret != ::pegasus::PERR_TIMEOUT || try_count > 3) {
fmt::print(stderr, "Set returned an error: {}\n", _client->get_error_string(ret));
dsn_exit(1);
} else {
Expand Down

0 comments on commit 2837b17

Please sign in to comment.