Copilot commented on code in PR #2483: URL: https://github.com/apache/iceberg-go/pull/2483#discussion_r4518117641
########## table/staged_replay.go: ########## @@ -0,0 +1,145 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package table + +import ( + "context" + "fmt" + "slices" + "time" + + "github.com/apache/iceberg-go/io" +) + +type stagedReplay struct { + branch string + records []expirationRecord + + // Record positions stay fixed even when replanning changes the update count. + // Snapshots use their most recent rebuild. + updates []Update + + // Refs walked by expiries that produced updates. + walkedRefs []string + + // Updates from the last successful replay. + // ran distinguishes an empty replay from no replay. + landed []Update + ran bool +} + +func newStagedReplay(branch string, updates []Update, records []expirationRecord) *stagedReplay { + return &stagedReplay{ + branch: branch, + records: records, + updates: slices.Clone(updates), + walkedRefs: stagedWalkedRefs(records), + } +} Review Comment: The extracted `stagedReplay` is now in a generic-looking file (`staged_replay.go`), but several identifiers/comments remain expiration-specific (`expirationRecord`, “Refs walked by expiries…”). Given the PR description says `stagedReplay` now handles every retried transaction (not just expirations), this is misleading. Consider either (a) adding a short doc comment on `stagedReplay` explaining `records` are only used for expiration replans and are empty for other transactions, or (b) renaming the fields/types to be replay-generic (and making the expiration-only meaning explicit elsewhere). -- 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]
