Introduction

  • No blocking primitives (e.g. locks)
  • FIFO Client ordering of all operations
  • linearizable writes
    • leader-based atomic broadcast - Zab

ZooKeeper Service

  • Hierarchy
    • Regular/Ephemeral node
  • Watch
    • trigger if data changed
  • Data model
    • Simplify Full read/write filesystem
  • API
    • Offer async and sync
    • access via full path
    • setData delete contain a version para
      • ignore if not match

Example

  • Leader configuration change
    • New leader delete ready node
    • New leader async update configuration nodes
    • Leader create ready node
    • Clients check if ready exist
  • Configuration Management
    • Processes share same configuration node
  • Rendezvous
    • Master want to share info with worker but master does not know info until started
    • Master pass node path to worker and write to the node
  • Group Membership
    • Create parent node
      • Children in node = member
  • Simple Lock
    • Clients create Ephemeral lock fail
    • Only one will succeed
    • Others watch

Implementation

ZooKeeperService.png

  • idempotent transaction
  • Read - Any servers
    • weak consistency
    • use sync if needed
  • Write - forward to a single server
    • leader calculate state
  • Client server exchange zxid (last transaction id)
    • Client connect only to servers with same or greater zxid

VS Chubby

  • No lock
  • No blocking primitives
    • Chubby blocks update while invalidating others’ cache
  • Access via full path (vs fh)
  • Chubby redirect all operations to master
    • Chubby stricter consistency
    • Chubby slower