Integration / Apache Pulsar Interview questions
Explain the execution flow of topic ownership failover in Pulsar?
Every broker maintains a live session with the metadata store using a short-lived, renewable registration; as long as the broker is healthy, it keeps renewing that session, implicitly proving it's still alive and reachable.
When a broker crashes or becomes network-partitioned, it stops renewing its session, and after the session timeout elapses, the metadata store expires it - this is the trigger the rest of the cluster watches for, not any direct crash notification from the failed broker itself.
The cluster's load manager, running as logic within the surviving brokers, observes the expired session, determines which bundles the failed broker owned, and reassigns each one to a healthy broker based on current load - no data is copied because it already lives durably in BookKeeper, independent of which broker owned it.
The newly assigned broker opens the relevant managed ledgers (topic data) and cursors (subscription positions) directly from BookKeeper metadata, resuming service from exactly where the previous owner left off.
Clients performing a topic lookup during or after this window get redirected to the new owning broker automatically by the Pulsar client library's built-in retry/backoff and lookup-refresh logic, so from the application's perspective, service resumes with a brief pause rather than requiring manual reconnection logic.
flowchart TD A[Broker session stops renewing] --> B[Metadata store session expires] B --> C[Load manager detects orphaned bundles] C --> D[Reassign bundles to healthy broker] D --> E[New broker opens existing ledgers/cursors from BookKeeper] E --> F[Clients redirected via lookup on reconnect]
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
