Skip to content

Commit

Permalink
Options::wal_dir shouldn't end in '/'
Browse files Browse the repository at this point in the history
Summary: If a client specifies wal_dir with trailing '/', we will fail in deleting obsolete log files. See task #4083746

Test Plan: make check

Reviewers: haobo, sdong

Reviewed By: haobo

CC: leveldb

Differential Revision: https://reviews.facebook.net/D17535
  • Loading branch information
igorcanadi committed Apr 7, 2014
1 parent f01a04e commit 7efdd9e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions db/db_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,9 @@ Options SanitizeOptions(const std::string& dbname,
// Use dbname as default
result.wal_dir = dbname;
}
if (result.wal_dir.back() == '/') {
result.wal_dir = result.wal_dir.substr(result.wal_dir.size() - 1);
}

// -- Sanitize the table properties collector
// All user defined properties collectors will be wrapped by
Expand Down

0 comments on commit 7efdd9e

Please sign in to comment.