From a3527a6d2259c056b32576cb1c5171f5208f0bc6 Mon Sep 17 00:00:00 2001 From: Austin Date: Tue, 13 Oct 2026 15:39:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B0=86=20im=5Ffilemsglinks.msgid=20?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E7=B1=BB=E5=9E=8B=E4=BB=8E=20INT=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=20BIGINT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 该字段原类型为 INT,最大值仅为 2147483647,而消息 ID 是雪花算法生成的 int64 类型值,插入时会超出范围导致失败。失败的 Kafka 消息持久化消费者会无限重试,阻塞分区及后续消息的持久化。此修改适用于 2026-10-13 之前部署的所有环境,全局非租户分片表仅需执行一次。 --- .../generate/im_filemsglinks_msgid_bigint.sql | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 server/storage/data/generate/im_filemsglinks_msgid_bigint.sql diff --git a/server/storage/data/generate/im_filemsglinks_msgid_bigint.sql b/server/storage/data/generate/im_filemsglinks_msgid_bigint.sql new file mode 100644 index 0000000..c332060 --- /dev/null +++ b/server/storage/data/generate/im_filemsglinks_msgid_bigint.sql @@ -0,0 +1,15 @@ +-- im_filemsglinks.msgid: INT -> BIGINT +-- +-- Background: message ids are snowflake int64 values (~1.58e18). The msgid +-- column was INT (max 2147483647), so every attempt to insert a message-file +-- link failed with MySQL error 1264 "Out of range value for column 'msgid'". +-- The failing Kafka message-persist consumer then retried the same message +-- forever, stalling its partition and blocking persistence for every message +-- queued behind it (p2p history stuck at old seqs while senders' seq kept +-- advancing in Redis). +-- +-- Applies to: any environment provisioned before 2026-10-13. im_filemsglinks +-- is a global (non tenant-sharded) table, so a single statement per DB is +-- enough. Verified online on the test env (table is small). + +ALTER TABLE im_filemsglinks MODIFY msgid BIGINT DEFAULT NULL;