{"record":{"id":"32534677b0299c34","repo":"apache/druid","slug":"cannot-pipeline-with-durable-storage","errorCode":null,"errorMessage":"Cannot pipeline with durable storage","messagePattern":"Cannot pipeline with durable storage","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"multi-stage-query/src/main/java/org/apache/druid/msq/kernel/controller/ControllerQueryKernelConfig.java","lineNumber":78,"sourceCode":"  {\n    if (maxRetainedPartitionSketchBytes <= 0) {\n      throw new IAE(\"maxRetainedPartitionSketchBytes must be positive\");\n    }\n\n    if (pipeline && maxConcurrentStages < 2) {\n      throw new IAE(\"maxConcurrentStagesPerWorker must be >= 2 when pipelining\");\n    }\n\n    if (maxConcurrentStages <= 0) {\n      throw new IAE(\"maxConcurrentStagesPerWorker must be positive\");\n    }\n\n    if (pipeline && faultTolerance) {\n      throw new IAE(\"Cannot pipeline with fault tolerance\");\n    }\n\n    if (pipeline && durableStorage) {\n      throw new IAE(\"Cannot pipeline with durable storage\");\n    }\n\n    if (faultTolerance && !durableStorage) {\n      throw new IAE(\"Cannot have fault tolerance without durable storage\");\n    }\n\n    this.maxRetainedPartitionSketchBytes = maxRetainedPartitionSketchBytes;\n    this.maxConcurrentStages = maxConcurrentStages;\n    this.pipeline = pipeline;\n    this.durableStorage = durableStorage;\n    this.faultTolerance = faultTolerance;\n    this.destination = destination;\n    this.controllerHost = controllerHost;\n    this.workerIds = workerIds;\n    this.workerContextMap = workerContextMap;\n  }\n\n  public static Builder builder()","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/multi-stage-query/src/main/java/org/apache/druid/msq/kernel/controller/ControllerQueryKernelConfig.java#L60-L96","documentation":"Pipelined stages cannot use durable storage for intermediate results; the constructor throws IAE when both pipeline and durableStorage are true. Pipelining keeps stage output in memory between workers, which is incompatible with durably storing intermediate results.","triggerScenarios":"Constructing ControllerQueryKernelConfig with pipeline=true and durableStorage=true, e.g. query context combining pipelining with durablyStoreTempResults / druid.msq.intermediate.storage.enabled-type durable storage settings.","commonSituations":"Cluster-level durable storage configured for fault tolerance plus a per-query pipelining flag; users copying durable-storage tuning blocks into pipelined queries.","solutions":["Turn off durable storage for pipelined queries (remove durablyStoreTempResults / intermediate storage settings).","Or disable pipelining if durable intermediate storage is required.","Enforce exclusivity in code that builds the query context before submission."],"exampleFix":"// before\ncontext.put(\"pipelinedStagesEnabled\", true);\ncontext.put(\"durablyStoreTempResults\", true);\n\n// after\ncontext.put(\"pipelinedStagesEnabled\", true);\ncontext.put(\"durablyStoreTempResults\", false);","handlingStrategy":"validation","validationCode":"if (ctx.getBoolean(\"pipelinedStagesEnabled\") && ctx.getBoolean(\"durablyStoreTempResults\")) {\n  throw new IllegalArgumentException(\"Pipelined queries cannot use durable storage for intermediates\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  submitQuery(ctx);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().contains(\"Cannot pipeline with durable storage\")) {\n    ctx.put(\"durablyStoreTempResults\", false);\n    submitQuery(ctx);\n  }\n}","preventionTips":["Don't copy durable-storage context blocks into pipelined query templates.","Check cluster-level intermediate storage config before enabling pipelining.","Validate all MSQ context flags together in a pre-submit lint function."],"tags":["msq","configuration","pipelining","durable-storage","conflicting-options"],"backgroundTag":"mutually-exclusive-flags","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}