This is an automated email from the ASF dual-hosted git repository.
laiyingchun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pegasus.git
The following commit(s) were added to refs/heads/master by this push:
new fe6f1f054 feat(FQDN): Use chkpt_<host>_<port> as the backup path
(#1958)
fe6f1f054 is described below
commit fe6f1f054cb2641d066717cf86e64186902b5d35
Author: Yingchun Lai <[email protected]>
AuthorDate: Tue Apr 9 17:16:14 2024 +0800
feat(FQDN): Use chkpt_<host>_<port> as the backup path (#1958)
Behavior changes:
Change the checkpoint directory name in remote storage system (e.g. HDFS)
from chkpt_ to chkpt_.
---
src/common/backup_common.cpp | 9 ++++-----
src/common/backup_common.h | 2 +-
src/replica/replica_stub.cpp | 2 +-
3 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/src/common/backup_common.cpp b/src/common/backup_common.cpp
index 0d58b8bf0..23575787c 100644
--- a/src/common/backup_common.cpp
+++ b/src/common/backup_common.cpp
@@ -18,8 +18,9 @@
#include "backup_common.h"
#include "common/gpid.h"
+#include "fmt/core.h"
#include "runtime/api_layer1.h"
-#include "runtime/rpc/rpc_address.h"
+#include "runtime/rpc/rpc_host_port.h"
namespace dsn {
namespace replication {
@@ -100,10 +101,8 @@ std::string get_current_chkpt_file(const std::string &root,
std::string get_remote_chkpt_dirname()
{
- // here using server address as suffix of remote_chkpt_dirname
- std::string local_address = dsn_primary_address().ipv4_str();
- std::string port = std::to_string(dsn_primary_address().port());
- return "chkpt_" + local_address + "_" + port;
+ return fmt::format(
+ "chkpt_{}_{}", dsn_primary_host_port().host(),
dsn_primary_host_port().port());
}
std::string get_remote_chkpt_dir(const std::string &root,
diff --git a/src/common/backup_common.h b/src/common/backup_common.h
index e0686977c..96e11717e 100644
--- a/src/common/backup_common.h
+++ b/src/common/backup_common.h
@@ -160,7 +160,7 @@ std::string get_current_chkpt_file(const std::string &root,
// compose the checkpoint directory name on block service
// return:
-// checkpoint directory name: checkpoint@<ip:port>
+// checkpoint directory name: chkpt_<host>_<port>
std::string get_remote_chkpt_dirname();
// compose the absolute path(AP) of checkpoint dir for replica on block service
diff --git a/src/replica/replica_stub.cpp b/src/replica/replica_stub.cpp
index 7c05198c5..43bdad322 100644
--- a/src/replica/replica_stub.cpp
+++ b/src/replica/replica_stub.cpp
@@ -530,7 +530,7 @@ void replica_stub::initialize(const replication_options
&opts, bool clear /* = f
LOG_INFO("{}@{}: load replica '{}'
success, <durable, "
"commit> = <{}, {}>,
last_prepared_decree = {}",
r->get_gpid(),
- dsn_primary_address(),
+ dsn_primary_host_port(),
dir,
r->last_durable_decree(),
r->last_committed_decree(),
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]