Skip to content

fix table xxl_job_registry id exhausted#3915

Open
s137740 wants to merge 2 commits intoxuxueli:masterfrom
s137740:fix-registry-id-burns
Open

fix table xxl_job_registry id exhausted#3915
s137740 wants to merge 2 commits intoxuxueli:masterfrom
s137740:fix-registry-id-burns

Conversation

@s137740
Copy link

@s137740 s137740 commented Jan 30, 2026

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

The description of the PR:

注册中心使用 SQL INSERT INTO xxl_job_registry xxxx ON DUPLICATE KEY UPDATE 来实现注册和更新,并针对 registry_group,registry_key,registry_value 三列设置唯一,猜测源于该 issue #2256

在更新场景下,由于 UNIQUE KEY 的存在,会导致数据库的自增主键不断增加,目前该表的主键是 int,存在被消耗殆尽的可能。

给个我司数据:生产有 300 个执行器 * 2 个 Pod(每个执行器),自增 ID 每天预计消耗 170 万,三年多就会用光。

至于 #2256 提及的并发问题,因为已经添加唯一键,所以可以简单地先查询后更新(或插入),遇到冲突可以 safely ignore。

Other information:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant