> The case you described here is "almost correct". But there is an key here:
> B2 can't startup itself if journal disk is wiped out, because the cookie is
> missed.
This is what I expected to see, but isn't the case.
<snip>
      List<Cookie> journalCookies = Lists.newArrayList();
            // try to read cookie from journal directory.
            for (File journalDirectory : journalDirectories) {
                try {
                    Cookie journalCookie =
Cookie.readFromDirectory(journalDirectory);
                    journalCookies.add(journalCookie);
                    if (journalCookie.isBookieHostCreatedFromIp()) {
                        conf.setUseHostNameAsBookieID(false);
                    } else {
                        conf.setUseHostNameAsBookieID(true);
                    }
                } catch (FileNotFoundException fnf) {
                    newEnv = true;
                    missedCookieDirs.add(journalDirectory);
                }
            }
</snip>

So if a journal is missing the cookie, newEnv is set to true. This
disabled the later checks.

> Hower it can still happen in a different case: bit flap. In your case, if
> fence bit in b2 is already persisted on disk, but it got corrupted. Then it
> will cause the issue you described. One problem is we don't have checksum
> on the index file header when it stores those fence bits.
Yes, this is also an issue.

-Ivan

Reply via email to