• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

apache / bookkeeper / 425
72%

Build:
DEFAULT BRANCH: master
Ran 20 Apr 2019 03:42PM UTC
Jobs 1
Files 528
Run time 24s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
425

push

jenkins

GitHub
ISSUE #1967: make ledger creation and removal robust to zk connectionloss


Descriptions of the changes in this PR:

The bookkeeper project ZooKeeperClient wrapper for the ZooKeeper client
will resend zk node creations and removals upon reconnect after a
ConnectionLoss event. In the event that the original succeeded, the
resent operation will erroneously return LedgerExistException or
NoSuchLedgerExistsException for creation and removal respectively.

For removal, this patch limits the operation by allowing it to always
succeed if the ledger does not exist in order to make it idempotent.
This is appears to be the simplest solution as exclusive removal isn't
important.

**Note, the above is an actual change to the bk client semantics**

For creation, exclusive creation is cleary important for correctness,
so this patch adds a creator token field to the LedgerMetdata to
disambiguate the above race from a real race. For
AbstractZkLedgerManager, this is simply a random long value.

There's an oportunity for optimization with the above if exclusive
ledger creation failures are expected to be common.  You only actually
need to perform this check if the operation was really resent.  I chose
not to go this route yet because it would require messing with the
ZooKeeperClient interface to surface that information without burdening
other callers.

If the client is set to version 2 or older, this field will be ignored
and the old behavior will be retained.  If the client is version 3 or
newer but creation races with an older client, the new client will
interpret the nonce to be BLANK and thereby detect the race correctly.



Reviewers: Enrico Olivelli <eolivelli@gmail.com>, Sijie Guo <sijie@apache.org>

This closes #2006 from reddycharan/zkretrialrobust, closes #1967

33 of 33 new or added lines in 4 files covered. (100.0%)

26706 of 37514 relevant lines covered (71.19%)

0.71 hits per line

Jobs
ID Job ID Ran Files Coverage
1 425.1 20 Apr 2019 03:42PM UTC 0
71.19
Source Files on build 425
  • Tree
  • List 0
  • Changed 32
  • Source Changed 6
  • Coverage Changed 32
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Jenkins Build #425
  • 407cb35e on github
  • Prev Build on master (#424)
  • Next Build on master (#426)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc