Fix shadow wal corruption on stalled validation
This commit fixes a timing bug that occurs in a specific scenario where the shadow wal sync stalls because of an s3 validation and the catch up write to the shadow wal is large enough to allow a window between WAL reads and the final copy. The file copy has been replaced by direct writes of the frame buffer to the shadow to ensure that every validated byte is exactly what is being written to the shadow wal. The one downside to this change is that the frame buffer will grow with the transaction size so it will use additional heap. This can be replaced by a spill-to-disk implementation but this should work well in the short term.
This commit is contained in:
@@ -95,9 +95,9 @@ type Pos struct {
|
||||
// String returns a string representation.
|
||||
func (p Pos) String() string {
|
||||
if p.IsZero() {
|
||||
return "<>"
|
||||
return ""
|
||||
}
|
||||
return fmt.Sprintf("<%s,%08x,%d>", p.Generation, p.Index, p.Offset)
|
||||
return fmt.Sprintf("%s/%08x:%d", p.Generation, p.Index, p.Offset)
|
||||
}
|
||||
|
||||
// IsZero returns true if p is the zero value.
|
||||
|
||||
Reference in New Issue
Block a user