{"record":{"id":"87deae7b6345655f","repo":"weaviate/weaviate","slug":"read-digest-in-range-record-w","errorCode":null,"errorMessage":"read digest in range record: %w","messagePattern":"read digest in range record: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"adapters/clients/replication.go","lineNumber":209,"sourceCode":"\t\t// Content-Length is peer-controlled; never pre-size beyond the request's own bound\n\t\trecordCount := contentLength / int64(replica.DigestObjectsInRangeRecordLength)\n\t\tif recordCount > int64(maxRecords) {\n\t\t\trecordCount = int64(maxRecords)\n\t\t}\n\t\t// a caller-supplied negative bound must not reach make\n\t\tif recordCount < 0 {\n\t\t\trecordCount = 0\n\t\t}\n\t\tresults = make([]types.RepairDigest, 0, int(recordCount))\n\t}\n\tvar buf [replica.DigestObjectsInRangeRecordLength]byte\n\tfor {\n\t\t_, err := io.ReadFull(r, buf[:])\n\t\tif stderrors.Is(err, io.EOF) {\n\t\t\treturn results, nil\n\t\t}\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"read digest in range record: %w\", err)\n\t\t}\n\t\tid, err := uuid.FromBytes(buf[:16])\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"parse uuid from binary record: %w\", err)\n\t\t}\n\t\tupdateTime := int64(binary.BigEndian.Uint64(buf[16:]))\n\t\tresults = append(results, types.RepairDigest{\n\t\t\tID:         id,\n\t\t\tUpdateTime: updateTime,\n\t\t})\n\t}\n}\n\n// CompareDigests sends the source's local digests to the target node using a\n// compact binary protocol (CompareDigestsRecordLength bytes per record) and\n// returns the subset that requires source-side action.\n//\n// Wire format: CompareDigestsRecordLength bytes per record —","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/adapters/clients/replication.go#L191-L227","documentation":"Wraps io.ReadFull failure while streaming fixed-size digest records from the binary response body in readDigestsInRangeBinaryStream. EOF terminates the stream cleanly; any other error (unexpected EOF, connection reset, read timeout) means the peer's binary payload was truncated or the connection broke mid-stream. Pre-sizing is clamped to the request's own bound precisely so this path cannot over-allocate from a peer-controlled Content-Length.","triggerScenarios":"网络中断，连接在传输中途被重置，或在流式传输二进制响应体时超时。","commonSituations":"目标节点与该节点之间的网络不稳定，目标节点在流式传输时崩溃/重启，或代理截断连接。","solutions":["重试摘要请求（异步复制调度程序将在下一个 tick 重试完整周期）。","检查两个节点之间的网络稳定性（数据包丢失、代理、超时）。","检查目标节点日志，查看在流式传输期间是否崩溃或重启。"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"digests, err := client.DigestObjectsInRange(ctx, host, index, shard, ...)\nif err != nil {\n    if strings.Contains(err.Error(), \"read digest in range record\") {\n        // stream interrupted — retry full request\n    }\n    return err\n}","preventionTips":["确保网络稳定，避免在节点之间设置激进的空闲超时或代理。","在流式传输时避免在目标节点上进行重量级的维护操作（重启/升级）。","使用 context deadlines 来防止无限挂起。"],"tags":["binary-stream","io","replication"],"backgroundTag":"stream-read-failed","analyzedSha":"75aa4b6d11f8818305aafd4440b4e32794f7ca04","analyzedAt":"2026-09-04T14:58:20.392Z","contentChangedAt":"2026-09-04T14:58:20.392Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}