Skip to content

Commit 18b2892

Browse files
committed
Fix SIGSEGV when table_properties is nullptr
Summary: out.table_properties is allowed to be nullptr if the compaction failed with a non-OK status. Because of how the code is structured, `CompactionJob::RetrieveResultsAndCleanup()` is called even if the compaction failed (it doesn't care about the results, but it cares about the cleanup). Test Plan: Compiles Reviewers: #sys-eng_team Differential Revision: https://rockset.phacility.com/D10613
1 parent a1a905a commit 18b2892

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

db/compaction/compaction_job.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1887,7 +1887,9 @@ void CompactionJob::RetrieveResultsAndCleanup(
18871887

18881888
OutputFile file;
18891889
file.pathname = path;
1890-
file.table_properties = *(out.table_properties);
1890+
if (out.table_properties) {
1891+
file.table_properties = *(out.table_properties);
1892+
}
18911893
file.file_size = out.meta.fd.file_size;
18921894
file.num_entries = out.meta.num_entries;
18931895
file.num_deletions = out.meta.num_deletions;

0 commit comments

Comments
 (0)