Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
acelyc111 committed Nov 30, 2023
1 parent cbfa1cf commit 6757c9b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 31 deletions.
19 changes: 8 additions & 11 deletions src/client/replication_ddl_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ DSN_DEFINE_uint32(ddl_client,
"The retry interval after receiving error from meta server.");

namespace dsn {

using utils::hostname_from_ip_port;
using utils::list_hostname_from_ip_port;

namespace replication {

#define VALIDATE_TABLE_NAME(app_name) \
Expand Down Expand Up @@ -517,8 +513,9 @@ std::string host_name_resolve(bool resolve_ip, std::string value)
{
if (resolve_ip) {
std::string temp;
// if (hostname_from_ip_port(value.c_str(), &temp))
// return temp;
if (dsn::utils::hostname_from_ip_port(value.c_str(), &temp)) {
return temp;
}
}
return value;
}
Expand Down Expand Up @@ -680,11 +677,11 @@ replication_ddl_client::cluster_info(const std::string &file_name, bool resolve_

if (resolve_ip) {
for (int i = 0; i < resp.keys.size(); ++i) {
// if (resp.keys[i] == "meta_servers") {
// list_hostname_from_ip_port(resp.values[i].c_str(), &resp.values[i]);
// } else if (resp.keys[i] == "primary_meta_server") {
// hostname_from_ip_port(resp.values[i].c_str(), &resp.values[i]);
// }
if (resp.keys[i] == "meta_servers") {
dsn::utils::list_hostname_from_ip_port(resp.values[i].c_str(), &resp.values[i]);
} else if (resp.keys[i] == "primary_meta_server") {
dsn::utils::hostname_from_ip_port(resp.values[i].c_str(), &resp.values[i]);
}
}
}

Expand Down
40 changes: 20 additions & 20 deletions src/meta/meta_state_service_simple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,26 +97,26 @@ void meta_state_service_simple::write_log(blob &&log_blob,
_task_queue.emplace(move(continuation_task));
_log_lock.unlock();

// ::dsn::file::write(_log,
// log_blob.data(),
// log_blob.length(),
// log_offset,
// LPC_META_STATE_SERVICE_SIMPLE_INTERNAL,
// &_tracker,
// [=](error_code err, size_t bytes) {
// CHECK(err == ERR_OK && bytes == log_blob.length(),
// "we cannot handle logging failure now");
// _log_lock.lock();
// continuation_task_ptr->done = true;
// while (!_task_queue.empty()) {
// if (!_task_queue.front()->done) {
// break;
// }
// _task_queue.front()->cb(true);
// _task_queue.pop();
// }
// _log_lock.unlock();
// });
::dsn::file::write(_log,
log_blob.data(),
log_blob.length(),
log_offset,
LPC_META_STATE_SERVICE_SIMPLE_INTERNAL,
&_tracker,
[=](error_code err, size_t bytes) {
CHECK(err == ERR_OK && bytes == log_blob.length(),
"we cannot handle logging failure now");
_log_lock.lock();
continuation_task_ptr->done = true;
while (!_task_queue.empty()) {
if (!_task_queue.front()->done) {
break;
}
_task_queue.front()->cb(true);
_task_queue.pop();
}
_log_lock.unlock();
});
}

error_code meta_state_service_simple::create_node_internal(const std::string &node,
Expand Down
1 change: 1 addition & 0 deletions thirdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ set(ROCKSDB_OPTIONS
-DWITH_TESTS=OFF
-DWITH_GFLAGS=OFF
-DUSE_RTTI=ON
-DROCKSDB_BUILD_SHARED=OFF
-DCMAKE_BUILD_TYPE=Release
-DWITH_JEMALLOC=${USE_JEMALLOC}
-DJEMALLOC_ROOT_DIR=${TP_OUTPUT}
Expand Down

0 comments on commit 6757c9b

Please sign in to comment.