Skip to content

Using shell generate an unexpected cookie #2145

@tal705

Description

@tal705

BUG REPORT

Describe the bug

When I run the order "bookkeeper shell cookie_generate", I got a new cookie, but this new cookie is different from the other cookie in zk.

Order( It belongs to pulsar ) :
./bin/bookkeeper shell cookie_generate -j data2/bookkeeper/journal -l data2/bookkeeper/ledgers -i 9285da1b-e1be-471b-8d11-d30d80212e68 -o /tmp/cookie.x 10.254.3.60:3181

The generated cookie is this:
4
bookieHost: "10.254.17.8:3181"
journalDir: "data2/bookkeeper/journal"
ledgerDirs: "data2/bookkeeper/ledgers"
instanceId: "3ed785b5-eb93-498c-9d57-b38ab8846e7b"

The cookie in zk is this :
4
bookieHost: "10.254.17.8:3181"
journalDir: "data/bookkeeper/journal"
ledgerDirs: "1\tdata/bookkeeper/ledgers"
instanceId: "3ed785b5-eb93-498c-9d57-b38ab8846e7b"

We can find the difference is "1\t" in two ledgerDirs, because of it, After I changed the dir and others operation, starting bookie is fail.

09:26:07.829 [main] ERROR org.apache.bookkeeper.server.Main - Failed to build bookie server
org.apache.bookkeeper.bookie.BookieException$InvalidCookieException: Cookie [4
bookieHost: "10.254.17.8:3181"
journalDir: "data2/bookkeeper/journal"
ledgerDirs: "1\tdata2/bookkeeper/ledgers"
instanceId: "3ed785b5-eb93-498c-9d57-b38ab8846e7b"
] is not matching with [4
bookieHost: "10.254.17.8:3181"
journalDir: "data/bookkeeper/journal"
ledgerDirs: "1\tdata/bookkeeper/ledgers"
instanceId: "3ed785b5-eb93-498c-9d57-b38ab8846e7b"

To Reproduce

As BUG says

Expected behavior

When I generate the cookie by the shell way, It should include "1\t"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions