-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Pass SST file checksum information through OnTableFileCreated #7108
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,6 +106,8 @@ Status BuildTable( | |
|
||
std::string fname = TableFileName(ioptions.cf_paths, meta->fd.GetNumber(), | ||
meta->fd.GetPathId()); | ||
std::string file_checksum = kUnknownFileChecksum; | ||
std::string file_checksum_func_name = kUnknownFileChecksumFuncName; | ||
#ifndef ROCKSDB_LITE | ||
EventHelpers::NotifyTableFileCreationStarted( | ||
ioptions.listeners, dbname, column_family_name, fname, job_id, reason); | ||
|
@@ -133,7 +135,8 @@ Status BuildTable( | |
if (!s.ok()) { | ||
EventHelpers::LogAndNotifyTableFileCreationFinished( | ||
event_logger, ioptions.listeners, dbname, column_family_name, fname, | ||
job_id, meta->fd, kInvalidBlobFileNumber, tp, reason, s); | ||
job_id, meta->fd, kInvalidBlobFileNumber, tp, reason, s, | ||
file_checksum, file_checksum_func_name); | ||
return s; | ||
} | ||
file->SetIOPriority(io_priority); | ||
|
@@ -232,6 +235,8 @@ Status BuildTable( | |
// Add the checksum information to file metadata. | ||
meta->file_checksum = file_writer->GetFileChecksum(); | ||
meta->file_checksum_func_name = file_writer->GetFileChecksumFuncName(); | ||
file_checksum = meta->file_checksum; | ||
file_checksum_func_name = meta->file_checksum_func_name; | ||
} | ||
|
||
if (s.ok()) { | ||
|
@@ -292,7 +297,8 @@ Status BuildTable( | |
// Output to event logger and fire events. | ||
EventHelpers::LogAndNotifyTableFileCreationFinished( | ||
event_logger, ioptions.listeners, dbname, column_family_name, fname, | ||
job_id, meta->fd, meta->oldest_blob_file_number, tp, reason, s); | ||
job_id, meta->fd, meta->oldest_blob_file_number, tp, reason, s, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Get rid of the temporary vars and use meta->file_checksum here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It will deal with the case that (io_status->ok() && !empty) is not satisfied, meta->file_checksum/file_checksum_func_name will be empty. I'm thinking it would be better to pass Unknown in this case. |
||
file_checksum, file_checksum_func_name); | ||
|
||
return s; | ||
} | ||
|
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.
Why not get rid of the two variables and use kUnknown here?