{"record":{"id":"4ed88f1bceb88b26","repo":"apache/hadoop","slug":"vecsum-zcr-loop-pass-d-failed-with-error-d-n","errorCode":null,"errorMessage":"vecsum_zcr_loop pass %d failed with error %d\\n","messagePattern":"vecsum_zcr_loop pass (.+?) failed with error (.+?)\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfs-tests/vecsum.c","lineNumber":642,"sourceCode":"    if (!zopts) {\n        fprintf(stderr, \"hadoopRzOptionsAlloc failed.\\n\");\n        ret = ENOMEM;\n        goto done;\n    }\n    if (hadoopRzOptionsSetSkipChecksum(zopts, 1)) {\n        ret = errno;\n        perror(\"hadoopRzOptionsSetSkipChecksum failed: \");\n        goto done;\n    }\n    if (hadoopRzOptionsSetByteBufferPool(zopts, NULL)) {\n        ret = errno;\n        perror(\"hadoopRzOptionsSetByteBufferPool failed: \");\n        goto done;\n    }\n    for (pass = 0; pass < opts->passes; ++pass) {\n        ret = vecsum_zcr_loop(pass, ldata, zopts, opts);\n        if (ret) {\n            fprintf(stderr, \"vecsum_zcr_loop pass %d failed \"\n                \"with error %d\\n\", pass, ret);\n            goto done;\n        }\n        hdfsSeek(ldata->fs, ldata->file, 0);\n    }\n    ret = 0;\ndone:\n    if (zopts)\n        hadoopRzOptionsFree(zopts);\n    return ret;\n}\n\ntSize hdfsReadFully(hdfsFS fs, hdfsFile f, void* buffer, tSize length)\n{\n    uint8_t *buf = buffer;\n    tSize ret, nread = 0;\n\n    while (length > 0) {","sourceCodeStart":624,"sourceCodeEnd":660,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfs-tests/vecsum.c#L624-L660","documentation":"Wrapper error: vecsum_zcr() reports that zero-copy pass number N failed with the error code returned by vecsum_zcr_loop() and aborts the remaining passes. The real cause is always printed immediately before by the loop itself (hadoopReadZero failure or partial read).","triggerScenarios":"Any nonzero return from vecsum_zcr_loop(): hadoopReadZero() returning NULL (short-circuit/domain-socket misconfiguration) or a partial chunk (file length not a multiple of ZCR_READ_CHUNK_SIZE). Failing on an early pass also skips all later passes, so a single transient error kills the whole zcr benchmark.","commonSituations":"First run of 'vecsum -t zcr' on a cluster without short-circuit reads enabled; running with an unaligned file length; DataNode restart mid-benchmark dropping the domain socket.","solutions":["Read the stderr line just above this one — it carries the root cause (hadoopReadZero errno or partial-read length).","Fix short-circuit config (dfs.client.read.shortcircuit + dfs.domain.socket.path) or align -l to 8 MiB as indicated by that underlying message.","Re-run the benchmark."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"/* prevent the two known loop failures up front */\nif (opts->length % ZCR_READ_CHUNK_SIZE) return EINVAL;  /* partial-read guard */\n/* plus: short-circuit config must be enabled before selecting zcr mode */","typeGuard":null,"tryCatchPattern":"ret = vecsum_zcr_loop(pass, ldata, zopts, opts);\nif (ret) {\n    /* ret is the errno from hadoopReadZero or EINVAL from a partial chunk —\n       dispatch on it rather than re-running blindly */\n    if (ret == ENOTSUP) { /* config problem: stop, do not retry more passes */ }\n    else if (ret == EINVAL) { /* alignment problem: stop */ }\n    else { /* transient I/O: safe to restart from pass 0 after hdfsSeek */ }\n}","preventionTips":["Treat this as an aggregator: always log and interpret the underlying loop error printed just before it.","Do not retry remaining passes after ENOTSUP/EINVAL — those are deterministic failures.","Re-seek to 0 (hdfsSeek) before any pass retry, mirroring what the loop itself does between successful passes."],"tags":["hdfs","vecsum","zero-copy","wrapper"],"backgroundTag":"zero-copy-read-failure","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}