[go: up one dir, main page]

Skip to content

Commit

Permalink
fix(bigquery/storage/managedwriter): schema evolution improvements (#…
Browse files Browse the repository at this point in the history
…7838)

This PR reorders the checks during append processing to ensure we handle schema evolution for both the multiplex and explicit connections correctly.
  • Loading branch information
shollyman committed May 1, 2023
1 parent a686cfc commit 49a1621
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions bigquery/storage/managedwriter/connection.go
Expand Up @@ -362,14 +362,14 @@ func (co *connection) lockingAppend(pw *pendingWrite) error {
var ch chan *pendingWrite
var err error

// We still need to reconnect if we need to signal a new schema for explicit streams.
// Rather than adding more state to the connection, we just look at the request as we
// do not allow multiplexing to include explicit streams.
// Handle promotion of per-request schema to default schema in the case of updates.
// Additionally, we check multiplex status as schema changes for explicit streams
// require reconnect, whereas multiplex does not.
forceReconnect := false
if !canMultiplex(pw.writeStreamID) {
if pw.writer != nil && pw.descVersion != nil && pw.descVersion.isNewer(pw.writer.curDescVersion) {
if pw.writer != nil && pw.descVersion != nil && pw.descVersion.isNewer(pw.writer.curDescVersion) {
pw.writer.curDescVersion = pw.descVersion
if !canMultiplex(pw.writeStreamID) {
forceReconnect = true
pw.writer.curDescVersion = pw.descVersion
}
}

Expand Down

0 comments on commit 49a1621

Please sign in to comment.