Skip to content

Commit e7a6fa0

Browse files
authored
[Bugfix] Race condittion when reading from batch (#314)
1 parent cd71310 commit e7a6fa0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

replication_impl.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,16 @@ func (c *client) DatabaseInventory(ctx context.Context, db Database) (DatabaseIn
101101
}
102102

103103
// BatchID reported by the server
104-
func (b batchMetadata) BatchID() string {
104+
// The receiver is pointer because this struct contains the field `closed` and it can not be copied
105+
// because race detector will complain.
106+
func (b *batchMetadata) BatchID() string {
105107
return b.ID
106108
}
107109

108110
// LastTick reported by the server for this batch
109-
func (b batchMetadata) LastTick() Tick {
111+
// The receiver is pointer because this struct contains the field `closed` and it can not be copied
112+
// because race detector will complain.
113+
func (b *batchMetadata) LastTick() Tick {
110114
return b.LastTickInt
111115
}
112116

0 commit comments

Comments
 (0)