Skip to content

Commit

Permalink
merge mv-hot-backup2 bug fix to 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew V committed Feb 15, 2017
1 parent 69a8fc1 commit d6507aa
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 5 deletions.
7 changes: 7 additions & 0 deletions BASHO_RELEASES
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
github.com tag 2.0.34 - February 15, 2017
-----------------------------------------
mv-hot-backup2: - correct MakeTieredDbname() within db/filename.cc
for case where dbname input is blank and fast/slow
already populated in options. Corrects issue
with hot backup in non-tiered storage situations

github.com tag 2.0.33 - November 21, 2016
-----------------------------------------
mv-bucket-expiry: - partial branch to enable X-Riak-Meta-Expiry-Base-Seconds
Expand Down
9 changes: 7 additions & 2 deletions db/filename.cc
Original file line number Diff line number Diff line change
Expand Up @@ -281,15 +281,20 @@ MakeTieredDbname(
const std::string & dbname, // input ... original dbname from DBImpl constructor
Options & options) // input/output ... writable Options, tiered values changed
{
if (0<(int)options.tiered_slow_level && (int)options.tiered_slow_level<config::kNumLevels
// case for "", used with internal calls to DestroyDB
if (0==dbname.size() && 0!=options.tiered_fast_prefix.size())
{
// do NOTHING ... options already initialized
} // if
else if (0<(int)options.tiered_slow_level && (int)options.tiered_slow_level<config::kNumLevels
&& 0!=options.tiered_fast_prefix.size() && 0!=options.tiered_slow_prefix.size())
{
options.tiered_fast_prefix.append("/");
options.tiered_fast_prefix.append(dbname);

options.tiered_slow_prefix.append("/");
options.tiered_slow_prefix.append(dbname);
}
} // else if
else
{
options.tiered_slow_level=0;
Expand Down
6 changes: 6 additions & 0 deletions db/filename_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@ TEST(FileNameTest, Construction) {
ASSERT_EQ("//mnt/fast/riak/data/leveldb", options.tiered_fast_prefix);
ASSERT_EQ("//mnt/slow/riak/data/leveldb", options.tiered_slow_prefix);

// special case with no dbname given, should have no changes
fname=MakeTieredDbname("", options);
ASSERT_EQ("//mnt/fast/riak/data/leveldb", fname);
ASSERT_EQ("//mnt/fast/riak/data/leveldb", options.tiered_fast_prefix);
ASSERT_EQ("//mnt/slow/riak/data/leveldb", options.tiered_slow_prefix);

}

} // namespace leveldb
Expand Down
2 changes: 1 addition & 1 deletion db/version_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class Version {
{
}

~Version();
virtual ~Version();

private:
// No copying allowed
Expand Down
2 changes: 1 addition & 1 deletion leveldb_ee
Submodule leveldb_ee updated 1 files
+68 −0 hot_backup_test.cc
2 changes: 1 addition & 1 deletion tools/sst_scan.cc
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ main(

if (value_dump)
{
uint64_t mod_time;
// uint64_t mod_time;

printf(" %s\n", HexString(it2->value()).c_str());
#if 0
Expand Down

0 comments on commit d6507aa

Please sign in to comment.