{"record":{"id":"7e44fcc83ea7a133","repo":"apache/pulsar","slug":"expected-target-metadata-store-to-be-oxia","errorCode":null,"errorMessage":"Expected target metadata store to be Oxia","messagePattern":"Expected target metadata store to be Oxia","errorType":"exception","errorClass":"MetadataStoreException","httpStatus":null,"severity":"error","filePath":"pulsar-metadata/src/main/java/org/apache/pulsar/metadata/coordination/impl/MigrationCoordinator.java","lineNumber":76,"sourceCode":"    private final Duration preparationTimeout;\n\n    private static final int MAX_PENDING_OPS = 1000;\n    private static final Duration DEFAULT_PREPARATION_TIMEOUT = Duration.ofSeconds(60);\n\n    public MigrationCoordinator(MetadataStore sourceStore, String targetUrl) throws MetadataStoreException {\n        this(sourceStore, targetUrl, DEFAULT_PREPARATION_TIMEOUT);\n    }\n\n    @VisibleForTesting\n    public MigrationCoordinator(MetadataStore sourceStore, String targetUrl, Duration preparationTimeout)\n            throws MetadataStoreException {\n        this.sourceStore = sourceStore;\n        this.targetUrl = targetUrl;\n        this.preparationTimeout = preparationTimeout;\n        this.migrationStateCache = sourceStore.getMetadataCache(MigrationState.class);\n\n        if (!targetUrl.startsWith(\"oxia://\")) {\n            throw new MetadataStoreException(\"Expected target metadata store to be Oxia\");\n        }\n\n        this.oxiaClient = new OxiaMetadataStoreProvider().getOxiaClient(targetUrl);\n    }\n\n    /**\n     * Start the migration process.\n     *\n     * @throws Exception if migration fails\n     */\n    public void startMigration() throws Exception {\n        log.info(\"=== Starting Migration ===\");\n        log.info().attr(\"source\", sourceStore.getClass().getSimpleName()).log(\"Source (current)\");\n        log.info().attr(\"target\", targetUrl).log(\"Target\");\n\n        // 1. Create migration flag. If another migration is already in progress, this fails without\n        // affecting the existing migration state.\n        setInitialMigrationPhase();","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-metadata/src/main/java/org/apache/pulsar/metadata/coordination/impl/MigrationCoordinator.java#L58-L94","documentation":"MigrationCoordinator migrates metadata from a source store to a target store. The PIP-462 migration tooling only supports Oxia as the target, so the constructor validates that the target URL starts with \"oxia://\" and otherwise throws MetadataStoreException with this message before creating the Oxia client.","triggerScenarios":"Constructing MigrationCoordinator with a targetUrl that does not begin with \"oxia://\" — e.g. \"zk://...\", \"rocksdb://...\", or a mistyped Oxia URL missing the scheme.","commonSituations":"Configuring a metadata migration with a ZooKeeper target by mistake; copying a target URL from older tooling predating Oxia-only targets; typo like \"oxia:/host\" (single slash).","solutions":["Set the migration target URL to an \"oxia://host:port\" style address","Correct typos in the URL scheme (must be exactly \"oxia://\")","If you intended to migrate to another backend, use a migration path that targets Oxia, then move off Oxia separately"],"exampleFix":"// before\nnew MigrationCoordinator(sourceStore, \"zk://zk1:2181/metadata\", timeout);\n// after\nnew MigrationCoordinator(sourceStore, \"oxia://oxia1:6648\", timeout);","handlingStrategy":"validation","validationCode":"// Java\nif (targetUrl == null || !targetUrl.startsWith(\"oxia://\")) {\n    throw new IllegalArgumentException(\"Migration target must be an oxia:// URL, got: \" + targetUrl);\n}\n","typeGuard":"boolean isOxiaTarget(String url) {\n    return url != null && url.startsWith(\"oxia://\");\n}\n","tryCatchPattern":"try {\n    coordinator = new MigrationCoordinator(sourceStore, targetUrl, timeout);\n} catch (MetadataStoreException e) {\n    // fix targetUrl to oxia:// scheme before retrying\n}\n","preventionTips":["Validate the target URL scheme (oxia://) in configuration before starting the migration","Keep migration target URLs in one config constant, not copy-pasted strings","Remember PIP-462 migration targets Oxia only"],"tags":["metadata-store","migration","oxia","configuration"],"backgroundTag":"unsupported-metadata-store-url","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"}