iceberg: detect table-exists through the wrapped manager error (#10075)

handleCreateTable used a type assertion that fails through WithFilerClient's
'all filers failed' wrap, so a concurrent create that the pre-check missed
fell through instead of returning the existing table. Use errors.As.
This commit is contained in:
Chris Lu
2026-06-24 10:22:36 -07:00
committed by GitHub
parent 3e2c637858
commit e744b5f2ee
+2 -1
View File
@@ -263,7 +263,8 @@ func (s *Server) handleCreateTable(w http.ResponseWriter, r *http.Request) {
})
if err != nil {
if tableErr, ok := err.(*s3tables.S3TablesError); ok && tableErr.Type == s3tables.ErrCodeTableAlreadyExists {
var tableErr *s3tables.S3TablesError
if errors.As(err, &tableErr) && tableErr.Type == s3tables.ErrCodeTableAlreadyExists {
getReq := &s3tables.GetTableRequest{
TableBucketARN: bucketARN,
Namespace: namespace,