harshilv17 opened a new issue, #2802: URL: https://github.com/apache/iceberg-go/issues/2802
`Transaction.ExpireSnapshots` replaces `t.tbl` while holding `t.mx` ([`t.tbl = base`](https://github.com/apache/iceberg-go/blob/5485692126ef94781e5c9b801cb30549b9d8f861/table/transaction.go#L873)) when the table was loaded with refs-only snapshot history. #2789 makes `Scan` and `StagedTable` read `t.tbl` under the lock, but the write paths still call `t.tbl.fsF(ctx)` without it: - [`Append`](https://github.com/apache/iceberg-go/blob/5485692126ef94781e5c9b801cb30549b9d8f861/table/transaction.go#L1024) - [`ReplaceDataFilesByPath`](https://github.com/apache/iceberg-go/blob/5485692126ef94781e5c9b801cb30549b9d8f861/table/transaction.go#L1099) - [`AddDataFiles`](https://github.com/apache/iceberg-go/blob/5485692126ef94781e5c9b801cb30549b9d8f861/table/transaction.go#L1741) - [`ReplaceDataFiles`](https://github.com/apache/iceberg-go/blob/5485692126ef94781e5c9b801cb30549b9d8f861/table/transaction.go#L1873) - [`replaceFiles`](https://github.com/apache/iceberg-go/blob/5485692126ef94781e5c9b801cb30549b9d8f861/table/transaction.go#L2090) - [`AddDataFilesByPath`](https://github.com/apache/iceberg-go/blob/5485692126ef94781e5c9b801cb30549b9d8f861/table/transaction.go#L2467) Running any of these at the same time as `ExpireSnapshots` on one transaction is a data race on `t.tbl`. A possible fix is to read `t.tbl` under `t.mx` once at the start of each method, as `Scan` does after #2789, and use that copy from then on. Raised by @laskoviymishka in https://github.com/apache/iceberg-go/pull/2789#pullrequestreview-6153808030. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
