hubcio opened a new pull request, #2723:
URL: https://github.com/apache/iggy/pull/2723
The message_cleaner can remove front segments from the log
vec while other operations yield at .await points on the
same compio thread. Code that captured a segment vec index
before an await and used it after would access the wrong
segment or panic on out-of-bounds.
Three fixes applied consistently:
1. delete_segments_base: pre-create the replacement segment
before draining, then drain + add in a single borrow_mut
so the log is never empty across awaits (prevents "active
segment called on empty log" panic). Removes the now-
unused init_log_in_local_partitions.
2. append_messages / rotate_segment: recompute segment_index
after each await instead of caching it before.
3. Polling (load_messages_from_disk, by_timestamp): replace
pre-computed segment_range with per-iteration re-resolve
by start_offset (stable identity). Extract shared lookup
into resolve_segment_storage helper that clones Rc readers
so fds survive concurrent segment deletion.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]