{"record":{"id":"171ac9a65b60e6d2","repo":"apache/shardingsphere","slug":"invalid-chunk-size-value-result-it-should","errorCode":null,"errorMessage":"Invalid 'chunk-size' value: `${result}`, it should be a positive integer.","messagePattern":"Invalid 'chunk-size' value: `(.+?)`, it should be a positive integer\\.","errorType":"validation","errorClass":"PipelineInvalidParameterException","httpStatus":null,"severity":"error","filePath":"kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/consistencycheck/table/DataMatchTableDataConsistencyChecker.java","lineNumber":73,"sourceCode":"    @Override\n    public void init(final Properties props) {\n        chunkSize = getChunkSize(props);\n        streamingRangeType = getStreamingRangeType(props);\n    }\n    \n    private int getChunkSize(final Properties props) {\n        String chunkSizeText = props.getProperty(CHUNK_SIZE_KEY);\n        if (Strings.isNullOrEmpty(chunkSizeText)) {\n            return DEFAULT_CHUNK_SIZE;\n        }\n        int result;\n        try {\n            result = Integer.parseInt(chunkSizeText);\n        } catch (final NumberFormatException ignore) {\n            throw new PipelineInvalidParameterException(\"'chunk-size' is not a valid number: `\" + chunkSizeText + \"`\");\n        }\n        if (result <= 0) {\n            throw new PipelineInvalidParameterException(\"Invalid 'chunk-size' value: `\" + result + \"`, it should be a positive integer.\");\n        }\n        return result;\n    }\n    \n    private StreamingRangeType getStreamingRangeType(final Properties props) {\n        String streamingRangeTypeText = props.getProperty(STREAMING_RANGE_TYPE_KEY);\n        if (Strings.isNullOrEmpty(streamingRangeTypeText)) {\n            return DEFAULT_STREAMING_RANGE_TYPE;\n        }\n        try {\n            return StreamingRangeType.valueOf(streamingRangeTypeText.toUpperCase());\n        } catch (final IllegalArgumentException ex) {\n            throw new PipelineInvalidParameterException(\"Invalid 'streaming-range-type' value: `\" + streamingRangeTypeText\n                    + \"`, expected values are \" + Arrays.toString(StreamingRangeType.values()));\n        }\n    }\n    \n    @Override","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/consistencycheck/table/DataMatchTableDataConsistencyChecker.java#L55-L91","documentation":"After successfully parsing 'chunk-size', DataMatchTableDataConsistencyChecker enforces that it is a positive integer; values of 0 or negatives raise PipelineInvalidParameterException('Invalid chunk-size value ... should be a positive integer'). The chunk size controls inventory range width during data matching, so non-positive values would produce empty or infinite dump loops and are rejected up front.","triggerScenarios":"Configuring chunk-size: 0, a negative number, or an expression that evaluates to <= 0 in the DATA_MATCH algorithm props of a migration/consistency-check job.","commonSituations":"Copying a config template with chunk-size: 0 meant to mean 'auto'; arithmetic in deployment tooling producing 0 (e.g. dividing batch size); someone lowering chunk-size below 1 to 'reduce load'.","solutions":["Set chunk-size to a positive integer >= 1 (typical values 1000-50000 depending on row width).","Omit chunk-size to accept the built-in default when unsure.","Add a config lint step that rejects non-positive numeric props before job submission."],"exampleFix":"# before\nprops:\n  chunk-size: 0\n\n# after\nprops:\n  chunk-size: 1000","handlingStrategy":"validation","validationCode":"int chunkSize = Integer.parseInt(props.getProperty(\"chunk-size\", String.valueOf(1000)));\nif (chunkSize <= 0) {\n    throw new IllegalArgumentException(\"chunk-size must be > 0, got: \" + chunkSize);\n}","typeGuard":null,"tryCatchPattern":"try {\n    new DataMatchTableDataConsistencyChecker(props);\n} catch (final PipelineInvalidParameterException ex) {\n    if (ex.getMessage().contains(\"chunk-size\")) { /* fix prop, resubmit job */ }\n}","preventionTips":["Use 0 only as 'not set' in tooling; strip it before submitting job props.","Template configs with a known-good chunk-size instead of 0."],"tags":["pipeline","consistency-check","configuration","validation"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}