fix: address Final Verification Wave findings
- Sync() now flushes BlockWriter before fd.Sync() for durability - Pre-validate encoding before sequence allocation (design doc compliance) - Remove dead _ = rec assignment in recover.go - Remove unused maxPayload field from SegmentWriter - Handle Put error in MemTable.Publish with panic on invariant violation
This commit is contained in:
@@ -145,6 +145,12 @@ func (ww *WalWriter) processBatch(requests []*CommitRequest) {
|
||||
return
|
||||
}
|
||||
|
||||
// Pre-validate encoding can succeed before sequence allocation.
|
||||
if _, err := EncodeWalBatch(0, entries); err != nil {
|
||||
ww.sendError(requests, err)
|
||||
return
|
||||
}
|
||||
|
||||
baseSequence, err := ww.seqManager.AllocateBatch(uint32(len(entries)))
|
||||
if err != nil {
|
||||
ww.sendError(requests, err)
|
||||
|
||||
Reference in New Issue
Block a user