Explorar o código

metadata: skip adding columns to tables which we dont have

Ff the schema is being updated we will race between seeing
the metadata be complete. Potentially we should check for
schema versions before and after reading the metadata and
if they dont match try again.
Chris Bannister %!s(int64=7) %!d(string=hai) anos
pai
achega
41a557b915
Modificáronse 1 ficheiros con 9 adicións e 1 borrados
  1. 9 1
      metadata.go

+ 9 - 1
metadata.go

@@ -243,7 +243,15 @@ func compileMetadata(
 			}
 		}
 
-		table := keyspace.Tables[col.Table]
+		table, ok := keyspace.Tables[col.Table]
+		if !ok {
+			// if the schema is being updated we will race between seeing
+			// the metadata be complete. Potentially we should check for
+			// schema versions before and after reading the metadata and
+			// if they dont match try again.
+			continue
+		}
+
 		table.Columns[col.Name] = col
 		table.OrderedColumns = append(table.OrderedColumns, col.Name)
 	}