@@ -253,7 +253,7 @@ Aws::S3::Model::HeadObjectOutcome AwsS3ClientWrapper::HeadObject(
253253 t.SetSuccess (outcome.IsSuccess ());
254254 return outcome;
255255}
256-
256+
257257//
258258// The AWS credentials are specified to the constructor via
259259// access_key_id and secret_key.
@@ -1459,7 +1459,7 @@ Status AwsEnv::SaveIdentitytoS3(const std::string& localfile,
14591459
14601460 // Save mapping from ID to cloud pathname
14611461 if (st.ok () && !GetDestObjectPath ().empty ()) {
1462- st = SaveDbid (dbid, GetDestObjectPath ());
1462+ st = SaveDbid (GetDestBucketName (), dbid, GetDestObjectPath ());
14631463 }
14641464 return st;
14651465}
@@ -1468,14 +1468,14 @@ Status AwsEnv::SaveIdentitytoS3(const std::string& localfile,
14681468// All db in a bucket are stored in path /.rockset/dbid/<dbid>
14691469// The value of the object is the pathname where the db resides.
14701470//
1471- Status AwsEnv::SaveDbid (const std::string& dbid, const std::string& dirname) {
1471+ Status AwsEnv::SaveDbid (const std::string& bucket_name, const std::string& dbid,
1472+ const std::string& dirname) {
14721473 assert (status ().ok ());
14731474 Log (InfoLogLevel::DEBUG_LEVEL, info_log_, " [s3] SaveDbid dbid %s dir '%s'" ,
14741475 dbid.c_str (), dirname.c_str ());
14751476
14761477 std::string dbidkey = dbid_registry_ + dbid;
1477- std::string bucket = GetDestBucketName ();
1478- Aws::String s3_bucket = ToAwsString (bucket);
1478+ Aws::String s3_bucket = ToAwsString (bucket_name);
14791479 Aws::String key = ToAwsString (dbidkey);
14801480
14811481 Aws::Map<Aws::String, Aws::String> metadata;
@@ -1497,11 +1497,11 @@ Status AwsEnv::SaveDbid(const std::string& dbid, const std::string& dirname) {
14971497 std::string errmsg (error.GetMessage ().c_str (), error.GetMessage ().size ());
14981498 Log (InfoLogLevel::ERROR_LEVEL, info_log_,
14991499 " [s3] Bucket %s SaveDbid error in saving dbid %s dirname %s %s" ,
1500- bucket .c_str (), dbid.c_str (), dirname.c_str (), errmsg.c_str ());
1500+ bucket_name .c_str (), dbid.c_str (), dirname.c_str (), errmsg.c_str ());
15011501 return Status::IOError (dirname, errmsg.c_str ());
15021502 }
15031503 Log (InfoLogLevel::INFO_LEVEL, info_log_,
1504- " [s3] Bucket %s SaveDbid dbid %s dirname %s %s" , bucket .c_str (),
1504+ " [s3] Bucket %s SaveDbid dbid %s dirname %s %s" , bucket_name .c_str (),
15051505 dbid.c_str (), dirname.c_str (), " ok" );
15061506 return Status::OK ();
15071507};
@@ -1880,7 +1880,7 @@ Status AwsEnv::NewLogger(const std::string& fname, shared_ptr<Logger>* result) {
18801880}
18811881
18821882// The factory method for creating an S3 Env
1883- Status AwsEnv::NewAwsEnv (Env* base_env,
1883+ Status AwsEnv::NewAwsEnv (Env* base_env,
18841884 const CloudEnvOptions& cloud_options,
18851885 const std::shared_ptr<Logger> & info_log, CloudEnv** cenv) {
18861886 Status status;
0 commit comments