Skip to content

Commit

Permalink
db: recover sstable generation counter on startup
Browse files Browse the repository at this point in the history
Don't attempt to overwrite an existing sstable.
  • Loading branch information
avikivity authored and tgrabiec committed Jul 20, 2015
1 parent 5339783 commit 6ade74b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions database.cc
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,8 @@ future<> column_family::probe_file(sstring sstdir, sstring fname) {
}

auto generation = boost::lexical_cast<unsigned long>(comps[1]);
// Make sure new sstables don't overwrite this one.
_sstable_generation = std::max<uint64_t>(_sstable_generation, generation / smp::count + 1);

try {
format = sstable::format_from_sstring(comps[2]);
Expand Down

0 comments on commit 6ade74b

Please sign in to comment.