Skip to content

Commit 052b22b

Browse files
committed
Fix build errors after rebase
1 parent d6fb3d4 commit 052b22b

File tree

7 files changed

+50
-43
lines changed

7 files changed

+50
-43
lines changed

cloud/cloud_file_system.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <unordered_map>
1111

1212
#include "cloud/aws/aws_file_system.h"
13-
#include "cloud/cloud_file_system_impl.h"
13+
#include "rocksdb/cloud/cloud_file_system_impl.h"
1414
#include "cloud/cloud_log_controller_impl.h"
1515
#include "cloud/cloud_manifest.h"
1616
#include "cloud/db_cloud_impl.h"
@@ -450,7 +450,7 @@ Status CloudFileSystemEnv::NewAwsFileSystem(
450450
return NewAwsFileSystem(base_fs, options, logger, cfs);
451451
}
452452

453-
Status CloudFileSystem::NewGcpFileSystem(
453+
Status CloudFileSystemEnv::NewGcpFileSystem(
454454
const std::shared_ptr<FileSystem>& base_fs,
455455
const std::string& src_cloud_bucket, const std::string& src_cloud_object,
456456
const std::string& src_cloud_region, const std::string& dest_cloud_bucket,
@@ -669,18 +669,18 @@ Status CloudFileSystemEnv::NewAwsFileSystem(
669669
#endif
670670

671671
#ifndef USE_GCP
672-
Status CloudFileSystem::NewGcpFileSystem(
672+
Status CloudFileSystemEnv::NewGcpFileSystem(
673673
const std::shared_ptr<FileSystem>& /*base_fs*/,
674674
const CloudFileSystemOptions& /*options*/,
675675
const std::shared_ptr<Logger>& /*logger*/, CloudFileSystem** /*cfs*/) {
676676
return Status::NotSupported("RocksDB Cloud not compiled with GCP support");
677677
}
678678
#else
679-
Status CloudFileSystem::NewGcpFileSystem(
679+
Status CloudFileSystemEnv::NewGcpFileSystem(
680680
const std::shared_ptr<FileSystem>& base_fs,
681681
const CloudFileSystemOptions& options,
682682
const std::shared_ptr<Logger>& logger, CloudFileSystem** cfs) {
683-
CloudFileSystem::RegisterCloudObjects();
683+
CloudFileSystemEnv::RegisterCloudObjects();
684684
// Dump out cloud fs options
685685
options.Dump(logger.get());
686686

cloud/gcp/gcp_cs.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ namespace gcs = ::google::cloud::storage;
77
namespace gcp = ::google::cloud;
88
#endif
99

10-
#include "cloud/cloud_storage_provider_impl.h"
10+
#include "rocksdb/cloud/cloud_storage_provider_impl.h"
1111
#include "cloud/filename.h"
1212
#include "cloud/gcp/gcp_file_system.h"
1313
#include "rocksdb/cloud/cloud_file_system.h"
1414
#include "rocksdb/convenience.h"
15+
#include "port/port_posix.h"
1516
#include <inttypes.h>
17+
#include <fstream>
1618

1719
#ifdef _WIN32_WINNT
1820
#undef GetMessage
@@ -721,4 +723,4 @@ Status CloudStorageProviderImpl::CreateGcsProvider(
721723
#endif
722724
}
723725
} // namespace ROCKSDB_NAMESPACE
724-
#endif // ROCKSDB_LITE
726+
#endif // ROCKSDB_LITE

cloud/gcp/gcp_db_cloud_test.cc

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@
1212
#include <cinttypes>
1313
#include <filesystem>
1414

15-
#include "cloud/cloud_file_deletion_scheduler.h"
16-
#include "cloud/cloud_file_system_impl.h"
15+
#include "rocksdb/cloud/cloud_file_deletion_scheduler.h"
16+
#include "rocksdb/cloud/cloud_file_system_impl.h"
1717
#include "cloud/cloud_scheduler.h"
18-
#include "cloud/cloud_storage_provider_impl.h"
18+
#include "cloud/cloud_manifest.h"
19+
#include "rocksdb/cloud/cloud_storage_provider_impl.h"
1920
#include "cloud/db_cloud_impl.h"
2021
#include "cloud/filename.h"
2122
#include "cloud/manifest_reader.h"
@@ -80,7 +81,7 @@ class CloudTest : public testing::Test {
8081

8182
CloudFileSystem* afs;
8283
// create a dummy Gcp env
83-
ASSERT_OK(CloudFileSystem::NewGcpFileSystem(base_env_->GetFileSystem(),
84+
ASSERT_OK(CloudFileSystemEnv::NewGcpFileSystem(base_env_->GetFileSystem(),
8485
cloud_fs_options_,
8586
options_.info_log, &afs));
8687
ASSERT_NE(afs, nullptr);
@@ -140,7 +141,7 @@ class CloudTest : public testing::Test {
140141
// Cleanup the cloud bucket
141142
if (!cloud_fs_options_.src_bucket.GetBucketName().empty()) {
142143
CloudFileSystem* afs;
143-
Status st = CloudFileSystem::NewGcpFileSystem(base_env_->GetFileSystem(),
144+
Status st = CloudFileSystemEnv::NewGcpFileSystem(base_env_->GetFileSystem(),
144145
cloud_fs_options_,
145146
options_.info_log, &afs);
146147
if (st.ok()) {
@@ -155,11 +156,11 @@ class CloudTest : public testing::Test {
155156

156157
void CreateCloudEnv() {
157158
CloudFileSystem* cfs;
158-
ASSERT_OK(CloudFileSystem::NewGcpFileSystem(base_env_->GetFileSystem(),
159+
ASSERT_OK(CloudFileSystemEnv::NewGcpFileSystem(base_env_->GetFileSystem(),
159160
cloud_fs_options_,
160161
options_.info_log, &cfs));
161162
std::shared_ptr<FileSystem> fs(cfs);
162-
aenv_ = CloudFileSystem::NewCompositeEnv(base_env_, std::move(fs));
163+
aenv_ = CloudFileSystemEnv::NewCompositeEnv(base_env_, std::move(fs));
163164
}
164165

165166
// Open database via the cloud interface
@@ -245,7 +246,7 @@ class CloudTest : public testing::Test {
245246
copt.keep_local_sst_files = true;
246247
}
247248
// Create new Gcp env
248-
Status st = CloudFileSystem::NewGcpFileSystem(
249+
Status st = CloudFileSystemEnv::NewGcpFileSystem(
249250
base_env_->GetFileSystem(), copt, options_.info_log, &cfs);
250251
if (!st.ok()) {
251252
return st;
@@ -2447,7 +2448,7 @@ TEST_F(CloudTest, DisableObsoleteFileDeletionOnOpenTest) {
24472448
// obsolete files are not deleted
24482449
EXPECT_EQ(GetAllLocalFiles().size(), 8);
24492450
// obsolete files are deleted!
2450-
db_->EnableFileDeletions(false /* force */);
2451+
db_->EnableFileDeletions();
24512452
EXPECT_EQ(GetAllLocalFiles().size(), 6);
24522453
CloseDB();
24532454
}
@@ -2820,7 +2821,7 @@ TEST_F(CloudTest, SanitizeDirectoryTest) {
28202821
EXPECT_EQ(local_files.size(), 7);
28212822

28222823
EXPECT_OK(
2823-
GetCloudFileSystemImpl()->SanitizeDirectory(options_, dbname_, false));
2824+
GetCloudFileSystemImpl()->SanitizeLocalDirectory(options_, dbname_, false));
28242825

28252826
// cleaning up during sanitization not triggered
28262827
EXPECT_EQ(local_files.size(), GetAllLocalFiles().size());
@@ -2830,7 +2831,7 @@ TEST_F(CloudTest, SanitizeDirectoryTest) {
28302831
base_env_->DeleteFile(MakeCloudManifestFile(dbname_, "" /* cooke */)));
28312832

28322833
EXPECT_OK(
2833-
GetCloudFileSystemImpl()->SanitizeDirectory(options_, dbname_, false));
2834+
GetCloudFileSystemImpl()->SanitizeLocalDirectory(options_, dbname_, false));
28342835

28352836
local_files = GetAllLocalFiles();
28362837
// IDENTITY file is downloaded after cleaning up, which is the only file that
@@ -2852,7 +2853,7 @@ TEST_F(CloudTest, SanitizeDirectoryTest) {
28522853
base_env_->DeleteFile(MakeCloudManifestFile(dbname_, "" /* cooke */)));
28532854

28542855
ASSERT_OK(
2855-
GetCloudFileSystemImpl()->SanitizeDirectory(options_, dbname_, false));
2856+
GetCloudFileSystemImpl()->SanitizeLocalDirectory(options_, dbname_, false));
28562857

28572858
// IDENTITY file + the random directory we created
28582859
EXPECT_EQ(GetAllLocalFiles().size(), 2);
@@ -2874,7 +2875,7 @@ TEST_F(CloudTest, SanitizeDirectoryTest) {
28742875
base_env_->DeleteFile(MakeCloudManifestFile(dbname_, "" /* cooke */)));
28752876

28762877
ASSERT_OK(
2877-
GetCloudFileSystemImpl()->SanitizeDirectory(options_, dbname_, false));
2878+
GetCloudFileSystemImpl()->SanitizeLocalDirectory(options_, dbname_, false));
28782879
SyncPoint::GetInstance()->DisableProcessing();
28792880
}
28802881

@@ -3145,4 +3146,4 @@ int main(int, char**) {
31453146
return 0;
31463147
}
31473148

3148-
#endif // !ROCKSDB_LITE
3149+
#endif // !ROCKSDB_LITE

cloud/gcp/gcp_file_system.cc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
#ifdef USE_GCP
44

5+
#include "cloud/gcp/gcp_file_system.h"
6+
57
#include <string>
68

9+
#include "rocksdb/cloud/cloud_storage_provider_impl.h"
710
#include "rocksdb/convenience.h"
811
#include "rocksdb/utilities/object_registry.h"
912

10-
#include "cloud/gcp/gcp_file_system.h"
11-
#include "cloud/cloud_storage_provider_impl.h"
12-
1313
namespace ROCKSDB_NAMESPACE {
1414
GcpFileSystem::GcpFileSystem(std::shared_ptr<FileSystem> const& underlying_fs,
1515
CloudFileSystemOptions const& cloud_options,
@@ -28,7 +28,8 @@ Status GcpFileSystem::NewGcpFileSystem(
2828
}
2929
std::unique_ptr<GcpFileSystem> gfs(
3030
new GcpFileSystem(fs, cloud_options, info_log));
31-
auto env = gfs->NewCompositeEnvFromThis(Env::Default());
31+
auto env =
32+
CloudFileSystemEnv::NewCompositeEnvFromFs(gfs.get(), Env::Default());
3233
ConfigOptions config_options;
3334
config_options.env = env.get();
3435
status = gfs->PrepareOptions(config_options);
@@ -107,4 +108,4 @@ int CloudFileSystemImpl::RegisterGcpObjects(ObjectLibrary& library,
107108
}
108109
} // namespace ROCKSDB_NAMESPACE
109110
#endif // USE_GCP
110-
#endif // ROCKSDB_LITE
111+
#endif // ROCKSDB_LITE

cloud/gcp/gcp_file_system.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#pragma once
22

33
#include <memory>
4-
#include "cloud/cloud_file_system_impl.h"
4+
#include "rocksdb/cloud/cloud_file_system_impl.h"
5+
#include "cloud/filename.h"
56

67
#ifdef USE_GCP
78

@@ -36,4 +37,4 @@ class GcpCloudOptions {
3637
google::cloud::Options& options);
3738
};
3839
} // namespace ROCKSDB_NAMESPACE
39-
#endif
40+
#endif

cloud/gcp/gcp_file_system_test.cc

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
#ifndef ROCKSDB_LITE
44

5-
#ifdef USE_GCP
5+
#include <cstdio>
66

7-
#include "rocksdb/cloud/cloud_file_system.h"
7+
#ifdef USE_GCP
88

99
#include "cloud/cloud_log_controller_impl.h"
10-
#include "cloud/cloud_storage_provider_impl.h"
10+
#include "rocksdb/cloud/cloud_file_system.h"
1111
#include "rocksdb/cloud/cloud_log_controller.h"
1212
#include "rocksdb/cloud/cloud_storage_provider.h"
13+
#include "rocksdb/cloud/cloud_storage_provider_impl.h"
1314
#include "rocksdb/convenience.h"
1415
#include "rocksdb/env.h"
1516
#include "test_util/testharness.h"
@@ -114,7 +115,7 @@ TEST(CloudFileSystemTest, ConfigureEnv) {
114115

115116
ConfigOptions config_options;
116117
config_options.invoke_prepare_options = false;
117-
ASSERT_OK(CloudFileSystem::CreateFromString(
118+
ASSERT_OK(CloudFileSystemEnv::CreateFromString(
118119
config_options, "keep_local_sst_files=true", &cfs));
119120
ASSERT_NE(cfs, nullptr);
120121
ASSERT_STREQ(cfs->Name(), "cloud");
@@ -128,7 +129,7 @@ TEST(CloudFileSystemTest, TestInitialize) {
128129
BucketOptions bucket;
129130
ConfigOptions config_options;
130131
config_options.invoke_prepare_options = false;
131-
ASSERT_OK(CloudFileSystem::CreateFromString(
132+
ASSERT_OK(CloudFileSystemEnv::CreateFromString(
132133
config_options, "id=cloud; TEST=cloudenvtest:/test/path", &cfs));
133134
ASSERT_NE(cfs, nullptr);
134135
ASSERT_STREQ(cfs->Name(), "cloud");
@@ -138,7 +139,7 @@ TEST(CloudFileSystemTest, TestInitialize) {
138139
ASSERT_EQ(cfs->GetSrcObjectPath(), "/test/path");
139140
ASSERT_TRUE(cfs->SrcMatchesDest());
140141

141-
ASSERT_OK(CloudFileSystem::CreateFromString(
142+
ASSERT_OK(CloudFileSystemEnv::CreateFromString(
142143
config_options, "id=cloud; TEST=cloudenvtest2:/test/path2?here", &cfs));
143144
ASSERT_NE(cfs, nullptr);
144145
ASSERT_STREQ(cfs->Name(), "cloud");
@@ -148,7 +149,7 @@ TEST(CloudFileSystemTest, TestInitialize) {
148149
ASSERT_EQ(cfs->GetCloudFileSystemOptions().src_bucket.GetRegion(), "here");
149150
ASSERT_TRUE(cfs->SrcMatchesDest());
150151

151-
ASSERT_OK(CloudFileSystem::CreateFromString(
152+
ASSERT_OK(CloudFileSystemEnv::CreateFromString(
152153
config_options,
153154
"id=cloud; TEST=cloudenvtest3:/test/path3; "
154155
"src.bucket=my_bucket; dest.object=/my_path",
@@ -166,7 +167,7 @@ TEST(CloudFileSystemTest, ConfigureGcpEnv) {
166167
std::unique_ptr<CloudFileSystem> cfs;
167168

168169
ConfigOptions config_options;
169-
Status s = CloudFileSystem::CreateFromString(
170+
Status s = CloudFileSystemEnv::CreateFromString(
170171
config_options, "id=gcp; keep_local_sst_files=true", &cfs);
171172
#ifdef USE_GCP
172173
ASSERT_OK(s);
@@ -188,14 +189,14 @@ TEST(CloudFileSystemTest, ConfigureGcsProvider) {
188189
std::unique_ptr<CloudFileSystem> cfs;
189190

190191
ConfigOptions config_options;
191-
Status s =
192-
CloudFileSystem::CreateFromString(config_options, "provider=gcs", &cfs);
192+
Status s = CloudFileSystemEnv::CreateFromString(config_options,
193+
"provider=gcs", &cfs);
193194
ASSERT_NOK(s);
194195
ASSERT_EQ(cfs, nullptr);
195196

196197
#ifdef USE_GCP
197-
ASSERT_OK(CloudFileSystem::CreateFromString(config_options,
198-
"id=gcp; provider=gcs", &cfs));
198+
ASSERT_OK(CloudFileSystemEnv::CreateFromString(config_options,
199+
"id=gcp; provider=gcs", &cfs));
199200
ASSERT_STREQ(cfs->Name(), "gcp");
200201
ASSERT_NE(cfs->GetStorageProvider(), nullptr);
201202
ASSERT_STREQ(cfs->GetStorageProvider()->Name(),
@@ -204,7 +205,6 @@ TEST(CloudFileSystemTest, ConfigureGcsProvider) {
204205
}
205206
} // namespace ROCKSDB_NAMESPACE
206207

207-
208208
int main(int argc, char** argv) {
209209
::testing::InitGoogleTest(&argc, argv);
210210
return RUN_ALL_TESTS();
@@ -220,11 +220,11 @@ int main(int, char**) {
220220
}
221221
#endif // USE_GCP
222222

223-
#else // ROCKSDB_LITE
223+
#else // ROCKSDB_LITE
224224
#include <stdio.h>
225225

226226
int main(int, char**) {
227227
fprintf(stderr, "SKIPPED as DBCloud is not supported in ROCKSDB_LITE.\n");
228228
return 0;
229229
}
230-
#endif // ROCKSDB_LITE
230+
#endif // ROCKSDB_LITE

db/version_set.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5902,7 +5902,9 @@ Status VersionSet::ProcessManifestWrites(
59025902
auto epoch = db_options_->replication_epoch_extractor
59035903
->EpochOfReplicationSequence(
59045904
*pending_persist_replication_sequence);
5905+
#ifndef NDEBUG
59055906
bool replication_epoch_set_empty = replication_epochs_.empty();
5907+
#endif
59065908
replication_epochs_.DeleteEpochsBefore(epoch);
59075909
// If replication epoch set is not empty before pruning, then it won't
59085910
// be empty after pruning

0 commit comments

Comments
 (0)