问HN:我们刚刚遇到了一个实际的UUID v4冲突……

3作者: mittermayr1 天前原帖
今天早上,我们的系统因为数据库中出现重复的UUID(v4)而抛出了错误。我检查了一下,以为可能是双重插入的bug,但并不是。<p>在2025年(大约一年前),同样的UUID v4已经存在于数据库中:<p>b6133fd6-70fe-4fe3-bed6-8ca8fc9386cd<p>我们使用的是这个:<p>https://www.npmjs.com/package/uuid<p>我的意思是,大家都说这在技术上是不可能的,绝对不会发生。<p>但我们并没有对UUID做什么魔法,我们只是生成它们以插入到SQL中,而且并不是高频率的操作……数据库大约有15000条记录。<p>这有发生在其他人身上过吗?!
查看原文
This morning, our system threw an error because of a duplicate UUID (v4) in the database. I checked, thinking it may have been a double-insert bug or something, but no.<p>In 2025 (about a year ago), that same UUID v4 was already in the database:<p>b6133fd6-70fe-4fe3-bed6-8ca8fc9386cd<p>We&#x27;re using this: https:&#x2F;&#x2F;www.npmjs.com&#x2F;package&#x2F;uuid<p>I mean, everyone says this is technically impossible, and it will never happen.<p>But there&#x27;s no magic we&#x27;re doing with our UUIDs, we&#x27;re generating them to insert into SQL, and it&#x27;s not even high-volume... the database has about 15.000 records.<p>Has that ever happened to anyone?!