rraulinio opened a new pull request, #1266: URL: https://github.com/apache/iceberg-go/pull/1266
# Summary Closes https://github.com/apache/iceberg-go/issues/1265. Fixes two table-package races found when running `go test -race ./table/...`, and expands CI race coverage to include the table package. The first race was in `PartitionSpec.PartitionToPath()`. `PartitionField.EscapedName()` previously populated `escapedName` lazily, so the first concurrent calls to `PartitionToPath()` could mutate the same shared partition spec fields from multiple writer goroutines. This PR moves cache population into `PartitionSpec.initialize()` and makes `EscapedName()` read-only at call time: it returns the precomputed value when present, and otherwise computes `url.QueryEscape(p.Name)` without writing back. The second race was test-side. Several parallel table tests passed the package-level `iceberg.PositionalDeleteSchema` directly into `MetadataBuilder.AddSchema`. `AddSchema` assigns the schema ID on the schema object it receives, so parallel tests could mutate/read the same shared schema pointer at the same time. This PR adds a small test helper that clones `PositionalDeleteSchema` before giving it to `AddSchema`, then updates the affected tests to use the clone. With both races fixed, CI now runs the race detector over both `./codec/...` and `./table/...`. # Testing ```text go test -race ./table/... ok github.com/apache/iceberg-go/table 27.394s ok github.com/apache/iceberg-go/table/compaction 48.721s ok github.com/apache/iceberg-go/table/dv (cached) ok github.com/apache/iceberg-go/table/internal (cached) ok github.com/apache/iceberg-go/table/substrait (cached) ``` Also verified the updated CI race target locally: ```bash go test -race ./codec/... ./table/... ``` -- 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]
