{"record":{"id":"8f420b46a4afc84a","repo":"openzipkin/zipkin","slug":"indexfetchmultiplier-0","errorCode":null,"errorMessage":"indexFetchMultiplier <= 0","messagePattern":"indexFetchMultiplier <= 0","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"zipkin-storage/cassandra/src/main/java/zipkin2/storage/cassandra/CassandraStorageBuilder.java","lineNumber":193,"sourceCode":"  public B maxTraceCols(int maxTraceCols) {\n    if (maxTraceCols <= 0) throw new IllegalArgumentException(\"maxTraceCols <= 0\");\n    this.maxTraceCols = maxTraceCols;\n    return (B) this;\n  }\n\n  /**\n   * How many more index rows to fetch than the user-supplied query limit. Defaults to 3.\n   *\n   * <p>Backend requests will request {@link QueryRequest#limit()} times this factor rows from\n   * Cassandra indexes in attempts to return {@link QueryRequest#limit()} traces.\n   *\n   * <p>Indexing in cassandra will usually have more rows than trace identifiers due to factors\n   * including table design and collection implementation. As there's no way to DISTINCT out\n   * duplicates server-side, this over-fetches client-side when {@code indexFetchMultiplier} &gt;\n   * 1.\n   */\n  public B indexFetchMultiplier(int indexFetchMultiplier) {\n    if (indexFetchMultiplier <= 0) throw new IllegalArgumentException(\"indexFetchMultiplier <= 0\");\n    this.indexFetchMultiplier = indexFetchMultiplier;\n    return (B) this;\n  }\n}\n","sourceCodeStart":175,"sourceCodeEnd":198,"githubUrl":"https://github.com/openzipkin/zipkin/blob/878ce2a1fad54ca941d17fdcf2e1d924b148eb1f/zipkin-storage/cassandra/src/main/java/zipkin2/storage/cassandra/CassandraStorageBuilder.java#L175-L198","documentation":"Thrown by CassandraStorageBuilder.indexFetchMultiplier(int) when the value is zero or negative. This multiplier decides how many index rows to fetch relative to the user's query limit (default 3), over-fetching to compensate for duplicate trace ids in Cassandra indexes. Zero or negative would make the fetch useless, so the builder rejects it.","triggerScenarios":"Calling indexFetchMultiplier(0) or a negative value on CassandraStorage.newBuilder(); deriving the multiplier from arithmetic that underflows to 0 or a negative number.","commonSituations":"Tuning configs copied from blog posts with a value of 0 meaning 'no over-fetch'; properties files where the key is misspelled and a 0 default is used.","solutions":["Use a positive multiplier, typically the default 3 (or >= 1 if you accept fewer duplicate traces deduped).","Validate any config-sourced multiplier for > 0 before passing it to the builder."],"exampleFix":"// before\n.indexFetchMultiplier(0)\n\n// after\n.indexFetchMultiplier(3)","handlingStrategy":"validation","validationCode":"int m = config.getInt(\"cassandra.index-fetch-multiplier\", 3);\nif (m <= 0) throw new IllegalArgumentException(\"indexFetchMultiplier must be > 0, got \" + m);\nbuilder.indexFetchMultiplier(m);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat '0' in tuning configs as invalid, not as 'disabled'; reject early.","Keep the default (3) unless measurements justify changing it."],"tags":["cassandra","zipkin","builder","validation","query-tuning"],"backgroundTag":null,"analyzedSha":"878ce2a1fad54ca941d17fdcf2e1d924b148eb1f","analyzedAt":"2026-08-14T15:17:09.895Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}