You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 23, 2025. It is now read-only.
Currently, rotateLog method returns errors for sync and csf.Close, but explicitly panics if opening a new segment file fails. This panic behavior is not good for a robust WAL system, as it can lead to application crashes and potential data inconsistency or corruption if a new segment cannot be created.
Figure out the critical edge cases and conditions where this method will throw error and handle them gracefully or return properly logged error messages.
Replace the panic during os.OpenFile failure with a graceful error return, logging the critical failure.
Review periodicRotateSegment: Ensure the caller of rotateLog (periodicRotateSegment) is equipped to handle the returned errors gracefully (e.g., logging, retries, or shutting down if unrecoverable).
Refer the below TODOs in the method for more context
// TODO: Ideally this function should not return any error
// Check for the conditions where it can return an error
// and handle them gracefully.
// I fear that we will need to do some cleanup operations in case of errors.
// TODO: We are panicking here because we are not handling the error
// and we want to make sure that the WAL is not corrupted.
// We need to handle this error gracefully.
Setup Instructions
setup DiceDB server locally from the source - instructions
setup DiceDB Go SDK locally from the source - instructions
setup DiceDB CLI locally from the source - instructions
refer to the Pointing to local checked-out dicedb-gosection inREADME`.
Start the DiceDB server
$ go run main.go --log-level debug
Follow the contribution guidelines
These are general guidelines to follow before you submit a patch. Please mark them as done once you complete them