Each tag upsert locks its row until commit, and tags were written in the order the caller listed them. A PATCH listing them in another order than an upload, a scan or another edit of a sequence sharing two of them could lock the rows in opposite orders, and PostgreSQL aborted one writer with a deadlock that nothing retries. Tags are now written in the order of their keys, and a set the sequence already carries is not written again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC