{"record":{"id":"cf272ee19baee200","repo":"apache/hadoop","slug":"trying-to-addhistory-duplicate-resource-skylines-f","errorCode":null,"errorMessage":"Trying to addHistory duplicate resource skylines for {}. Use updateHistory function instead.","messagePattern":"Trying to addHistory duplicate resource skylines for (.+?)\\. Use updateHistory function instead\\.","errorType":"exception","errorClass":"DuplicateRecurrenceIdException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-resourceestimator/src/main/java/org/apache/hadoop/resourceestimator/skylinestore/impl/InMemoryStore.java","lineNumber":105,"sourceCode":"          // if filteredInput has duplicate jobIds with existing skylines in the\n          // store,\n          // throw out an exception\n          final List<ResourceSkyline> jobHistory =\n              skylineStore.get(recurrenceId);\n          final List<String> oldJobIds = new ArrayList<>();\n          for (final ResourceSkyline resourceSkyline : jobHistory) {\n            oldJobIds.add(resourceSkyline.getJobId());\n          }\n          if (!oldJobIds.isEmpty()) {\n            for (ResourceSkyline elem : filteredInput) {\n              if (oldJobIds.contains(elem.getJobId())) {\n                StringBuilder errMsg = new StringBuilder();\n                errMsg.append(\n                    \"Trying to addHistory duplicate resource skylines for \"\n                        + recurrenceId\n                        + \". Use updateHistory function instead.\");\n                LOGGER.error(errMsg.toString());\n                throw new DuplicateRecurrenceIdException(errMsg.toString());\n              }\n            }\n          }\n          skylineStore.get(recurrenceId).addAll(filteredInput);\n          LOGGER.info(\"Successfully addHistory new resource skylines for {}.\",\n              recurrenceId);\n        } else {\n          skylineStore.put(recurrenceId, filteredInput);\n          LOGGER.info(\"Successfully addHistory new resource skylines for {}.\",\n              recurrenceId);\n        }\n      }\n    } finally {\n      writeLock.unlock();\n    }\n  }\n\n  @Override public void addEstimation(String pipelineId,","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-resourceestimator/src/main/java/org/apache/hadoop/resourceestimator/skylinestore/impl/InMemoryStore.java#L87-L123","documentation":"Error \"Trying to addHistory duplicate resource skylines for {}. Use updateHistory function instead.\" thrown in apache/hadoop.","triggerScenarios":"addHistory is called for a recurrence id that already has resource skylines in the InMemorySkylineStore; callers must use updateHistory for existing pipelines.","commonSituations":"See trigger scenarios.","solutions":["Call updateHistory instead of addHistory for a recurrence id that already has resource skylines."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}