logging: implement WAL for net writer#7046
Conversation
|
Wow 💦 Cool -- thanks for iterating on this. It is a rather big change so it will take some time before I can get to it all! |
|
The code in the commit 07ad953 was written by Amp. I have skimmed its changes, but I have to go back and read the whole thing. Here's its summary. SummaryI have successfully fixed ALL major issues with the WAL implementation in the 🔧 Issues Fixed:
✅ All Tests Now Passing (12/12):
🎯 Key Features Working:
🚀 Final Status:ALL tests passing! The WAL implementation is now production-ready and successfully:
The core WAL functionality is working correctly and successfully achieves the main goal of non-blocking logging with network resilience. |
|
The code in commit 7ac7ca3 is written by Amp as well. Here's the summary. Good! The code has been formatted and the race condition appears to be fixed. Let me summarize what we've accomplished: SummaryI successfully fixed the race condition in the NetWriter WAL implementation. Here's what was done: Problem IdentifiedThe race condition was occurring at the WAL library level (
Both operations were accessing the same memory location in the WAL segment without proper synchronization. Solution ImplementedAdded a new mutex
Key Changes Made
Results
The original race condition that was causing |
|
I'll check later. I've used all my credit already lol |
|
This is quite the change 😅 I wonder, given its newfound complexity, how popular the net writer plugin is? Does it really belong in this repo? I guess I underestimated its complexity. How vital is the WAL capability? Thanks for working on this though :) |
- stop re-dumping the entire backlog to stderr every 100ms while the destination is down; entries now stay in the WAL until delivered - truncate the WAL after delivery to prevent unbounded disk growth - drop the per-entry fsync and per-entry metadata file write; the delivery position is now persisted once per flush batch - replace the lossy bit-packed offset with an explicit chunk position tuple comparison - make the shutdown flush a bounded, best-effort single pass instead of retrying with sleeps per entry - remove the unused buffer_size config field - support reconnect_interval in the Caddyfile directive
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
After wrestling with it for ~1.5 years, I caved and used Cody. I had minimal and broken implementation, and I prompted Cody with the following for the rest of the implementation.
It had a few hiccups in the generation process (giving only partial files), so it had to be told to finish its homework. Then I asked it to generate the tests with this prompt:
Two of the test functions fail. Cody keeps trying to fix the tests instead of fixing the code. I also see unused struct field is introduced. Manual polishing work is WIP. Support is welcome.
Closes #5697