{"record":{"id":"0d029cdaf6957337","repo":"apache/pulsar","slug":"ioexception-0d029c","errorCode":null,"errorMessage":"IOException","messagePattern":"IOException","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"pulsar-metadata/src/main/java/org/apache/pulsar/metadata/bookkeeper/PulsarLedgerManagerFactory.java","lineNumber":124,"sourceCode":"    }\n\n    @Override\n    public boolean validateAndNukeExistingCluster(AbstractConfiguration<?> conf,\n                                                  LayoutManager layoutManager)\n            throws InterruptedException, IOException {\n        @Cleanup\n        PulsarLedgerManager ledgerManager = new PulsarLedgerManager(store, ledgerRootPath);\n\n        /*\n         * before proceeding with nuking existing cluster, make sure there\n         * are no unexpected nodes under ledgersRootPath\n         */\n        final List<String> ledgersRootPathChildrenList;\n        try {\n            ledgersRootPathChildrenList = store.getChildren(ledgerRootPath)\n                    .get(BLOCKING_CALL_TIMEOUT, TimeUnit.MILLISECONDS);\n        } catch (ExecutionException | TimeoutException e) {\n            throw new IOException(e);\n        }\n        for (String ledgersRootPathChildren : ledgersRootPathChildrenList) {\n            if ((!AbstractZkLedgerManager.isSpecialZnode(ledgersRootPathChildren))\n                    && (!ledgerManager.isLedgerParentNode(ledgersRootPathChildren))) {\n                log.error().attr(\"node\", ledgersRootPathChildren).attr(\"ledgersRootPath\", ledgerRootPath)\n                        .log(\"Found unexpected node under ledgersRootPath, exiting nuke operation\");\n                return false;\n            }\n        }\n\n        // formatting ledgermanager deletes ledger znodes\n        format(conf, layoutManager);\n\n        // now delete all the special nodes recursively\n        final List<String> ledgersRootPathChildren;\n        try {\n            ledgersRootPathChildren = store.getChildren(ledgerRootPath)\n                    .get(BLOCKING_CALL_TIMEOUT, TimeUnit.MILLISECONDS);","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-metadata/src/main/java/org/apache/pulsar/metadata/bookkeeper/PulsarLedgerManagerFactory.java#L106-L142","documentation":"validateAndNukeExistingCluster lists the children of the ledgers root path by doing a blocking get() with a timeout on the metadata store future. If the store call fails asynchronously (ExecutionException) or does not complete within BLOCKING_CALL_TIMEOUT (TimeoutException), the failure is wrapped in an IOException and thrown.","triggerScenarios":"Running the nuke-cluster operation when the metadata store is unreachable, returns an error for getChildren on the ledgers root, or is too slow (network latency, overloaded store, GC pauses) to answer within the blocking timeout.","commonSituations":"ZooKeeper/MetadataStore outage or quorum loss during a cluster teardown; network partition; very large ledgers root making listing slow; wrong connection settings causing hangs.","solutions":["Verify metadata store connectivity and health before re-running the nuke operation.","Inspect the wrapped cause (e.getCause()) for the real store error and address it (auth, session expiry, no quorum).","Retry the operation once the store is responsive; nuke is idempotent up to the failed step.","If listings are slow, reduce store load or increase capacity; check for large znode trees."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// pre-check store reachability\nstore.exists(ledgerRootPath).get(BLOCKING_CALL_TIMEOUT, TimeUnit.MILLISECONDS);","typeGuard":null,"tryCatchPattern":"try {\n    validateAndNukeExistingCluster(...);\n} catch (IOException e) {\n    Throwable cause = e.getCause();\n    if (cause instanceof TimeoutException) { /* retry after store recovers */ }\n}","preventionTips":["Confirm metadata store quorum/health before running destructive nuke operations.","Stop brokers/bookies before nuking to avoid concurrent store load.","Monitor store latency so blocking timeouts are realistic."],"tags":["metadata-store","timeout","nuke-cluster","ioexception"],"backgroundTag":"metadata-store-timeout","analyzedSha":"820761864ed8e2a7d2e52dd9763ad2ae117c1395","analyzedAt":"2026-09-06T00:14:20.138Z","contentChangedAt":"2026-09-06T00:14:20.138Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}