-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DNM] Wal debug 6.29.tikv #356
base: 6.29.tikv
Are you sure you want to change the base?
Conversation
Signed-off-by: Qi Xu <[email protected]>
Signed-off-by: Qi Xu <[email protected]>
Signed-off-by: Qi Xu <[email protected]>
Signed-off-by: Qi Xu <[email protected]>
Signed-off-by: Qi Xu <[email protected]>
Signed-off-by: Qi Xu <[email protected]>
Signed-off-by: Qi Xu <[email protected]>
Signed-off-by: Qi Xu <[email protected]>
@tonyxuqqi What is the WAL recovery mode in tikv ? I guess that it should be kTolerateCorruptedTailRecords. |
which format is tikv using. Seems like rocksdb wal has two formats : legacy and recycle. Recycle format has more debug information (log number) . https://github.com/facebook/rocksdb/wiki/Write-Ahead-Log-File-Format |
Signed-off-by: Qi Xu <[email protected]>
Signed-off-by: Qi Xu <[email protected]>
"Start writing to WAL: [%" PRIu64 " ]", | ||
log_writer->get_log_number()); | ||
} | ||
if (log_writer->get_log_number() != logs_.back().number) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tonyxuqqi : At the beginning of the write, writer will reference the last WAL only. The race condition happens, while the write is ongoing. We should check this condition after the write.
@@ -1488,7 +1501,7 @@ IOStatus DBImpl::WriteToWAL(const WriteThread::WriteGroup& write_group, | |||
|
|||
uint64_t log_size; | |||
io_s = WriteToWAL(*merged_batch, log_writer, log_used, &log_size, | |||
log_file_number_size); | |||
log_file_number_size, 1); | |||
if (to_be_cached_state) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add a lot when the fsync happens in writeToWAL
rocksdb/db/db_impl/db_impl_write.cc
Line 1519 in 20225a4
io_s = log.writer->file()->Sync(immutable_db_options_.use_fsync); |
Signed-off-by: Qi Xu <[email protected]>
Signed-off-by: Qi Xu <[email protected]>
This reverts commit 844300e.
Signed-off-by: Qi Xu <[email protected]>
Signed-off-by: Qi Xu <[email protected]>
Signed-off-by: Qi Xu <[email protected]>
Signed-off-by: Qi Xu <[email protected]>
Signed-off-by: Qi Xu <[email protected]>
To debug WAL corruption issues