Skip to content

Commit 8d7ffda

Browse files
authored
Merge pull request #57 from PostHog/fix/ducklake-retry-count
Increase DuckLake max retry count to 100 for concurrent connections
2 parents 8afcfbf + e1bb56f commit 8d7ffda

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

server/server.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,16 @@ func (s *Server) attachDuckLake(db *sql.DB) error {
406406
}
407407

408408
log.Printf("Attached DuckLake catalog successfully")
409+
410+
// Set DuckLake max retry count to handle concurrent connections
411+
// DuckLake uses optimistic concurrency - when multiple connections commit
412+
// simultaneously, they may conflict on snapshot IDs. Default of 10 is too low
413+
// for tools like Fivetran that open many concurrent connections.
414+
if _, err := db.Exec("SET ducklake_max_retry_count = 100"); err != nil {
415+
log.Printf("Warning: failed to set ducklake_max_retry_count: %v", err)
416+
// Don't fail - this is not critical, DuckLake will use its default
417+
}
418+
409419
return nil
410420
}
411421

0 commit comments

Comments
 (0)