{"record":{"id":"f4539d59a3eb0f5a","repo":"apache/druid","slug":"failed-to-add-a-row-with-timestamp-s","errorCode":null,"errorMessage":"Failed to add a row with timestamp[%s]","messagePattern":"Failed to add a row with timestamp\\[(.+?)\\]","errorType":"exception","errorClass":"ISE","httpStatus":null,"severity":"error","filePath":"indexing-service/src/main/java/org/apache/druid/indexing/common/task/InputSourceProcessor.java","lineNumber":132,"sourceCode":"        if (addResult.isOk()) {\n          // incremental segment publishment is allowed only when rollup doesn't have to be perfect.\n          if (dynamicPartitionsSpec != null) {\n            final boolean isPushRequired = addResult.isPushRequired(\n                dynamicPartitionsSpec.getMaxRowsPerSegment(),\n                dynamicPartitionsSpec.getMaxTotalRowsOr(DynamicPartitionsSpec.DEFAULT_MAX_TOTAL_ROWS)\n            );\n            if (isPushRequired) {\n              // There can be some segments waiting for being pushed even though no more rows will be added to them\n              // in the future.\n              // If those segments are not pushed here, the remaining available space in appenderator will be kept\n              // small which could lead to smaller segments.\n              final SegmentsAndCommitMetadata pushed = driver.pushAllAndClear(pushTimeout);\n              segmentSchemaMapping.merge(pushed.getSegmentSchemaMapping());\n              LOG.debugSegments(pushed.getSegments(), \"Pushed segments\");\n            }\n          }\n        } else {\n          throw new ISE(\"Failed to add a row with timestamp[%s]\", inputRow.getTimestamp());\n        }\n      }\n\n      final SegmentsAndCommitMetadata pushed = driver.pushAllAndClear(pushTimeout);\n      segmentSchemaMapping.merge(pushed.getSegmentSchemaMapping());\n      LOG.debugSegments(pushed.getSegments(), \"Pushed segments\");\n\n      return Pair.of(pushed, segmentSchemaMapping);\n    }\n  }\n}\n","sourceCodeStart":114,"sourceCodeEnd":144,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/indexing-service/src/main/java/org/apache/druid/indexing/common/task/InputSourceProcessor.java#L114-L144","documentation":"During IndexTask row ingestion, the sink/appendeable failed to accept an input row (e.g. the segment sink is full, closed, or the row could not be added after retries). The processor aborts with ISE, treating it as an unrecoverable ingestion failure rather than dropping the row.","triggerScenarios":"driver.add(...) returns false for an input row, e.g. when the current sink is sealed/being pushed and a new sink cannot be created, or push/allocate failures leave no active sink for the row's timestamp.","commonSituations":"Very high late-arrival data hitting rows outside the windowPeriod while sinks are mid-push; task being killed/closed concurrently; tuning maxRowsInMemory/delayed flush so pushes race with row arrival.","solutions":["Inspect task logs immediately preceding this error for sink allocation or push failures and fix the root cause","Adjust query granularity/segment granularity so rows fall into valid buckets, or widen the task's windowPeriod for late data","Retry the failed task; if caused by transient push timeouts, increase pushTimeout or deep-storage retry settings"],"exampleFix":"// before\n// rows with timestamps far outside segmentGranularity buckets\n// after\n// set proper granularitySpec.rollup + query granularity, and configure\n// taskContext \"maxRowsInMemory\" so sinks flush before contention","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { runIngestion(spec); } catch (ISE e) { if (e.getMessage().startsWith(\"Failed to add a row\")) { retryTaskWithAdjustedWindows(spec); } else { throw e; } }","preventionTips":["Set windowPeriod generously for late data","Keep segment granularity coarse enough that rows fall into configured buckets","Monitor task logs for push/sink failures that precede this error"],"tags":["druid","indexing","ingestion"],"backgroundTag":"internal-invariant-violation","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"}