Options::wal_dir shouldn't end in '/'

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
main
Igor Canadi 10 years ago
parent f01a04ea2d
commit 7efdd9ef4d
  1. 3
      db/db_impl.cc

@ -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

Loading…
Cancel
Save