DEBUG-ONLY: use crc32 for rid fingerprint (builtin hash() is per-process randomized)

This commit is contained in:
2026-10-13 18:12:56 +08:00
parent db1e8cdbe3
commit 5df4f2c036
+3 -1
View File
@@ -22,6 +22,7 @@ from __future__ import annotations
import hashlib
import logging
import os
import zlib
from array import array
from collections import deque
from http import HTTPStatus
@@ -131,7 +132,8 @@ def _dbg_plan(self, batch) -> None:
fp = 0
ext_total = 0
for r in reqs:
fp = (fp * 131 + hash(r.rid)) & 0xFFFFFFFFFFFFFFFF
# crc32 而非 hash():后者按进程随机化种子,跨 rank 不可比
fp = (fp * 131 + zlib.crc32(r.rid.encode())) & 0xFFFFFFFFFFFFFFFF
er = getattr(r, "extend_range", None)
el = int(er.length) if er is not None else -1
fp = (fp * 131 + el) & 0xFFFFFFFFFFFFFFFF