Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EASY] Fix long int issue caused by timestamp #633

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions rocksdb_admin/admin_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,7 @@ void AdminHandler::async_tm_backupDBToS3(
LOG(INFO) << "S3 Backup " << request->db_name << " to " << request->s3_backup_dir;
auto ts = common::timeutil::GetCurrentTimestamp();
const std::string s3_tmp_path = getS3TmpPath();
auto local_path = folly::stringPrintf("%s%s%d/", s3_tmp_path.c_str(), request->db_name.c_str(), ts);
auto local_path = folly::stringPrintf("%s%s%ld/", s3_tmp_path.c_str(), request->db_name.c_str(), ts);
boost::system::error_code remove_err;
boost::system::error_code create_err;
boost::filesystem::remove_all(local_path, remove_err);
Expand Down Expand Up @@ -1176,7 +1176,7 @@ void AdminHandler::async_tm_restoreDBFromS3(
auto ts = common::timeutil::GetCurrentTimestamp();
const std::string s3_tmp_path = getS3TmpPath();
auto local_path = FLAGS_enable_checkpoint_backup ? FLAGS_rocksdb_dir + request->db_name :
folly::stringPrintf("%s%s%d/", s3_tmp_path.c_str(), request->db_name.c_str(), ts);
folly::stringPrintf("%s%s%ld/", s3_tmp_path.c_str(), request->db_name.c_str(), ts);
boost::system::error_code remove_err;
boost::system::error_code create_err;
boost::filesystem::remove_all(local_path, remove_err);
Expand Down
4 changes: 2 additions & 2 deletions rocksdb_admin/tests/s3_backup_integration_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,9 @@ TEST(S3BackupRestoreCheckpointTest, Basics) {

auto ts = common::timeutil::GetCurrentTimestamp();
std::string local_db_checkpoint_path = folly::stringPrintf(
"%s%s/%d", FLAGS_local_backup_dir.c_str(), test_db_name.c_str(), ts);
"%s%s/%ld", FLAGS_local_backup_dir.c_str(), test_db_name.c_str(), ts);
std::string formatted_s3_dir_path = folly::stringPrintf(
"%s/%s/%d/", FLAGS_s3_backup_prefix_checkpoint.c_str(),
"%s/%s/%ld/", FLAGS_s3_backup_prefix_checkpoint.c_str(),
test_db_name.c_str(), ts);

LOG(INFO) << "Create checkpoint for localDB: " << local_db_path
Expand Down