-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Open
Labels
Description
Hi,
I have two questions about process crash or system crash during leveldb::RepairDB
- In the flow Repairer::Run -> Repairer::WriteDescriptor.
In my understanding, 000001.dbtmp is created as a temporary file to store VersionSet information, then RenameFile to MANIFEST-000001. If the process crash before RenameFile called. the 000001.dbtmp left.
Is it possible that we fail to recover db in next time because of 000001.dbtmp exist ?
Status WriteDescriptor() {
std::string tmp = TempFileName(dbname_, 1);
WritableFile* file;
Status status = env_->NewWritableFile(tmp, &file);
if (!status.ok()) {
return status;
}
...
}If yes, is it safe that I delete the [0-9]+.dbtmp before Open db?
- When log.AddRecord(record) to 000001.dbtmp, EmitPhysicalRecord call Flush() to system buffer.
Is it content safe if system crash after RenameFile(000001.dbtmp, MANIFEST-000001).
Please forgive me if I misunderstand the code flow about recovery process.