Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] LedgerManagerFactory Info storing in LAYOUT znode is not correct #4094

Open
Reidddddd opened this issue Oct 3, 2023 · 0 comments
Open
Labels

Comments

@Reidddddd
Copy link
Contributor

Reidddddd commented Oct 3, 2023

BUG REPORT

Describe the bug

I configured the serviceURL with zk+longhierarchical which means using LongHierarchicalLedgerManager.

But after executing shell metaformat, in the LAYOUT znode is HierarchicalLedgerManager in fact.

To Reproduce

Here is a UT to reproduce:

    @Test
    public void testFormat() throws Exception {
        File tmpDir = tmpDirs.createNew("bookie", "test");
        final String zkRoot = "/ledgers3";

        final ServerConfiguration conf = TestBKConfiguration.newServerConfiguration()
            .setJournalDirName(tmpDir.getPath())
            .setLedgerDirNames(new String[] { tmpDir.getPath() })
            .setMetadataServiceUri(zkUtil.getMetadataServiceUri(zkRoot, "longhierarchical"))
            .setZkTimeout(5000);

        BookKeeperAdmin.format(conf, false, false);
        BookKeeperAdmin.format(conf, false, true); // need to set force true
    }

The second time will fail with exception:

Caused by: java.io.IOException: Configured layout org.apache.bookkeeper.meta.LongHierarchicalLedgerManagerFactory does not match existing layout org.apache.bookkeeper.meta.HierarchicalLedgerManagerFactory
	at org.apache.bookkeeper.meta.AbstractZkLedgerManagerFactory.newLedgerManagerFactory(AbstractZkLedgerManagerFactory.java:220)
	at org.apache.bookkeeper.meta.zk.ZKMetadataDriverBase.getLedgerManagerFactory(ZKMetadataDriverBase.java:263)
	... 21 more

Expected behavior

LedgerManagerFactory Info storing in the LAYOUT node should be exactly the same as configuration

And no matter how many time format execution, all should be successful with same configuration

Screenshots

N/A

Additional context

N/A

@Reidddddd Reidddddd changed the title [Bug] Info storing in LAYOUT znode is not correct [Bug] LedgerManagerFactory Info storing in LAYOUT znode is not correct Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant