From e744b5f2ee817fe460eb819f913775dbabb0627c Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Wed, 24 Jun 2026 10:22:36 -0700 Subject: [PATCH] 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. --- weed/s3api/iceberg/handlers_table.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/weed/s3api/iceberg/handlers_table.go b/weed/s3api/iceberg/handlers_table.go index 14728fd35..f33061885 100644 --- a/weed/s3api/iceberg/handlers_table.go +++ b/weed/s3api/iceberg/handlers_table.go @@ -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,