Fix alert entry traversal when doing cleanup (#19373)
Fix ae traversal on cleanup
Stelios Fragkakis committed
Jan 10, 2025 at 18:48 UTC
f9512b1a79993cfdcdc4cac23daa18e655101fd2
1 file changed
+2
-2
src/database/sqlite/sqlite_metadata.c
+2
-2
@@ -1772,7 +1772,7 @@ static void after_metadata_hosts(uv_work_t *req, int status __maybe_unused)
1772
struct scan_metadata_payload *data = req->data;
1773
struct metadata_wc *wc = data->wc;
1774
1775
- bool first = false;
1775
+ bool first = true;
1776
Word_t Index = 0;
1777
Pvoid_t *Pvalue;
1778
while ((Pvalue = JudyLFirstThenNext(wc->ae_DelJudyL, &Index, &first))) {
@@ -1780,7 +1780,7 @@ static void after_metadata_hosts(uv_work_t *req, int status __maybe_unused)
1780
if(!__atomic_load_n(&ae->pending_save_count, __ATOMIC_RELAXED)) {
1781
health_alarm_log_free_one_nochecks_nounlink(ae);
1782
(void) JudyLDel(&wc->ae_DelJudyL, Index, PJE0);
1783
- first = false;
1783
+ first = true;
1784
Index = 0;
1785
}
1786
}