Skip to content

Commit 6b3040b

Browse files
committed
Break early on non-OK status
1 parent bbdd28f commit 6b3040b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

db/db_impl/db_impl_open.cc

+6
Original file line numberDiff line numberDiff line change
@@ -1203,6 +1203,12 @@ Status DBImpl::ProcessLogFiles(
12031203
PredecessorWALInfo predecessor_wal_info;
12041204

12051205
for (auto wal_number : wal_numbers) {
1206+
// Detecting early break on the next iteration after `wal_number` has been
1207+
// advanced since this `wal_number` doesn't affect follow-up handling after
1208+
// breaking out of the for loop.
1209+
if (!status.ok()) {
1210+
break;
1211+
}
12061212
SequenceNumber prev_next_sequence = *next_sequence;
12071213
if (status.ok()) {
12081214
status = ProcessLogFile(

0 commit comments

Comments
 (0)