md sal clustering internals
play

MD-SAL Clustering Internals Moiz Raja Open Daylight Summit 2015 - PowerPoint PPT Presentation

MD-SAL Clustering Internals Moiz Raja Open Daylight Summit 2015 www.opendaylight.org My Collaborators Tom Pantelis Abhishek Kumar Luis Gomez Basheeruddin Ahmed Phillip Shea Colin


  1. MD-SAL Clustering Internals Moiz Raja Open Daylight Summit 2015 www.opendaylight.org

  2. My ¡Collaborators ¡ Tom Pantelis ▪ Abhishek ¡Kumar ¡ ▪ Luis ¡Gomez ¡ ▪ Basheeruddin ¡Ahmed ¡ ▪ Phillip ¡Shea ¡ ▪ Colin ¡Dixon ¡ ▪ Radhika ¡Hirannaiah ¡ ▪ Harman ¡Singh ¡ ▪ and ¡many ¡more… ¡ ▪ Kamal ¡Rameshan ¡ ▪ Robert ¡Varga ¡ ▪ Tony ¡Tkacik ¡ 2 www.opendaylight.org

  3. Agenda ¡ ▪ Architecture ¡ ▪ Modules ¡ ▪ Flows ¡ ▪ DiagnosHcs ¡ ▪ QuesHons ¡ ¡ www.opendaylight.org

  4. Architecture ¡ 4 www.opendaylight.org

  5. Subsystems member-­‑2 ¡ member-­‑1 ¡ member-­‑2 ¡ member-­‑1 ¡ member-­‑3 ¡ Remote RPC Connector Distributed Data Store 5 www.opendaylight.org

  6. High ¡Level ¡Architecture Distributed Data Store Remote RPC Connector Persistence Remoting Clustering www.opendaylight.org

  7. Actor ¡Systems Distributed Data Store Remote RPC Connector Actor Hierarchy Configuration Dispatchers 7 www.opendaylight.org

  8. Data ¡Synchroniza:on Data store Remote RPC Synchronized Data Tree Synchronized RPC Registry Raft for Distributed Consensus Gossip for data distribution 8 www.opendaylight.org

  9. Distributed ¡Data ¡Store ¡ Architecture ¡ 9 www.opendaylight.org

  10. Accessing ¡Remote ¡Data Client member-2 member-1 10 www.opendaylight.org

  11. Loca:on ¡Transparency DistributedDataStore Client member-2 member-1 11 www.opendaylight.org

  12. DistributedDataStore DOMStore DistributedDataStore 12 www.opendaylight.org

  13. Communica:on DistributedDataStore Client Shard member-2 member-1 13 www.opendaylight.org

  14. Data ¡Distribu:on DistributedDataStore inventory ¡ member-2 Client member-1 topology ¡ member-3 14 www.opendaylight.org

  15. Module ¡Based ¡Shards / /inventory /topology /toaster 15 www.opendaylight.org

  16. HA Client inventory ¡– ¡follower ¡-­‑1 ¡ DistributedDataStore member-2 inventory ¡– ¡leader ¡ inventory ¡– ¡follower ¡-­‑ ¡2 ¡ member-1 member-3 16 www.opendaylight.org

  17. RaB ¡Distributed ¡Consensus starts ¡up/ ¡ ¡ recovers ¡ Follower Hmes ¡out, ¡ ¡ discovers ¡node ¡with ¡higher ¡term ¡ ¡ starts ¡elecHons ¡ leader ¡ Candidate Hmes ¡out, ¡ ¡ restarts ¡elecHons ¡ receives ¡votes ¡ follower-­‑1 ¡ follower-­‑2 ¡ from ¡majority ¡ ¡ Leader of ¡nodes ¡ Election Replication/Consensus 17 www.opendaylight.org

  18. Journal ¡replica:on transaction-4 transaction-3 transaction-2 transaction-4 transaction-1 transaction-3 transaction-2 follower-1 transaction-1 transaction-4 leader transaction-3 transaction-2 transaction-1 follower-2 18 www.opendaylight.org

  19. Snapshot ¡Replica:on follower-1 leader follower-2 19 www.opendaylight.org

  20. Durability/Recovery Journal Snapshots 20 www.opendaylight.org

  21. Remote ¡RPC ¡Architecture ¡ 21 www.opendaylight.org

  22. Invoking ¡a ¡Remote ¡RPC Provider Consumer member-2 member-1 22 www.opendaylight.org

  23. Loca:on ¡Transparency RemoteRpcBroker RpcProviderProxy Provider Consumer member-2 member-1 23 www.opendaylight.org

  24. RPC ¡Registry RPC Registration Provider RPC Registry Listener 24 www.opendaylight.org

  25. RPC ¡Registry ¡Replica:on ¡-­‑ ¡Gossip modify ¡ m1,v1 ¡ m1 ¡ m2,v5 ¡ status ¡ m3,v7 ¡ All ¡buckets ¡and ¡their ¡ versions ¡known ¡to ¡all ¡ version=1 ¡ change ¡ members ¡ version ¡ status ¡ m2 ¡ m3 ¡ m1 ¡ Every ¡1 ¡second ¡members ¡ send ¡all ¡known ¡bucket ¡ ¡ ¡ e t versions ¡to ¡any ¡one ¡peer ¡ a version=2 ¡ d p u Local ¡bucket ¡updates ¡ ¡ change ¡version ¡ m2 ¡ m3 ¡ local ¡versions ¡higher ¡– ¡send ¡update ¡ local ¡versions ¡lower ¡– ¡send ¡status ¡to ¡sender ¡ 25 www.opendaylight.org

  26. Modules ¡ 26 www.opendaylight.org

  27. Modules clustering-test-app sal-clustering-config sal-clustering-commons sal-akka-raft sal-remoterpc-connector sal-distributed-datastore sal-akka-raft-example sal-dummy-distributed-datastore 27 www.opendaylight.org

  28. sal-­‑clustering-­‑commons ▪ Some ¡common ¡messages ¡ ▪ Actor ¡base ¡classes ¡ ▪ The ¡Protobuf ¡messages ¡used ¡in ¡Helium ¡ ▪ The ¡Protobuf ¡NormalizedNode ¡serializaHon ¡code ¡ ▪ The ¡NormalizedNode ¡streaming ¡code ¡ ▪ Other ¡miscellaneous ¡uHlity ¡classes ¡ 28 www.opendaylight.org

  29. sal-­‑akka-­‑raB ▪ ImplementaHon ¡of ¡the ¡Ra[ ¡Algorithm ¡on ¡top ¡of ¡akka ¡ ▪ Uses ¡akka-­‑persistence ¡for ¡durability ¡ ▪ Provides ¡a ¡base ¡class ¡called ¡ Ra:Actor ¡which ¡when ¡can ¡be ¡ extended ¡by ¡anyone ¡who ¡wants ¡to ¡replicate ¡state ¡ ▪ See ¡sal-­‑akka-­‑ra[-­‑example ¡which ¡provides ¡a ¡simple ¡ implementaHon ¡of ¡a ¡replicated ¡ HashMap ¡ 29 www.opendaylight.org

  30. sal-­‑distributed-­‑datastore ▪ ConcurrentDOMDataBroker ¡ ▪ DistributedDataStore ¡ ▪ ImplementaHon ¡of ¡the ¡ DOMStore ¡SPI ¡ ▪ Shard ¡built ¡on ¡top ¡of ¡Ra[Actor ¡ ▪ Creates ¡Shards ¡based ¡on ¡Sharding ¡strategy ¡ ▪ Code ¡for ¡a ¡client ¡to ¡interact ¡with ¡the ¡Shard ¡Leader ¡ 30 www.opendaylight.org

  31. sal-­‑remoterpc-­‑connector ▪ RemoteRpcProvider ¡ ▪ Default ¡RPC ¡Provider. ¡Invoked ¡when ¡an ¡RPC ¡is ¡not ¡found ¡in ¡ the ¡local ¡MD-­‑SAL ¡registry. ¡ ▪ Code ¡for ¡BucketStore ¡which ¡provides ¡a ¡mechanism ¡to ¡ replicate ¡state ¡based ¡on ¡Gossip ¡ ▪ Code ¡for ¡RpcBroker ¡which ¡allows ¡invoking ¡a ¡remote ¡rpc ¡ 31 www.opendaylight.org

  32. Data ¡store ¡flows ¡ 32 www.opendaylight.org

  33. Startup createInstance DistributedConfigDataStoreProviderModule create & waitTillReady waitTillReadyLatch DistributedDataStore ActorContext ShardManager Shard1 Shard Shard3 Shard4 33 www.opendaylight.org

  34. Recovery read last known state from disk Shard1 Shard Shard3 Shard4 ready ShardManager countDown waitTillReadyLatch 34 www.opendaylight.org

  35. Wai:ng ¡for ¡Ready ▪ Recovery ¡must ¡be ¡complete ¡ ▪ All ¡Shard ¡Leaders ¡must ¡be ¡known ¡ ▪ Three ¡messages ¡are ¡monitored ¡by ¡ShardManager ¡ ▪ Cluster.MemberStatusUp ▪ Used to figure out the address of a cluster member ▪ LeaderStateChanged ▪ Used to figure out if a Follower has a different Leader ▪ ShardRoleChanged ▪ Use to figured out any changes in a Shard’s Role ▪ WaiHng ¡is ¡not ¡infinite, ¡by ¡default ¡it ¡lasts ¡only ¡90 ¡seconds ¡but ¡ is ¡configurable ¡ ▪ Will ¡block ¡config ¡sub-­‑system ¡ 35 www.opendaylight.org

  36. Crea:ng ¡a ¡Transac:on newReadWriteTransaction DistributedDataStore create TransactionProxy 36 www.opendaylight.org

  37. First ¡Opera:on write(“inventory”, node) TransactionProxy ActorContext.findPrimary PrimaryCache.lookup/ ShardManager.findPrimary N NoOpTransactionContext Found? N Y RemoteTransactionContext Local? LocalTransactionContext 37 www.opendaylight.org

  38. Transac:ons Client member-1 Client member-1 DistributedDataStore DistributedDataStore member-2 inventory ¡– ¡leader ¡ inventory ¡– ¡leader ¡ Local Transaction Remote Transaction 38 www.opendaylight.org

  39. Local ¡Transac:on ¡Op:miza:on write merge delete ready LocalTransactionContext Shard - Leader member-1 39 www.opendaylight.org

  40. Remote ¡Transac:on ¡Op:miza:on write write ¡mod ¡ merge ¡mod ¡ merge delete ¡mod ¡ delete ready RemoteTransactionContext Shard Leader member-1 member-2 40 www.opendaylight.org

  41. Transac:on ¡Rate ¡Limi:ng rate-limit = 100 Tx/Sec Tx 20ms Cohort 50ms Tx Cohort 15ms Tx Cohort Shard Leader after rate-limit/2 transactions done…. member-2 new-rate-limit = 25 Tx/Sec 41 www.opendaylight.org

  42. Opera:on ¡Limi:ng write write ¡mod ¡ merge ¡mod ¡ merge delete ¡mod ¡ delete … ¡ … RemoteTransactionContext Shard Leader block member-1 member-2 42 www.opendaylight.org

  43. Commit ¡Coordina:on Tx1 ¡-­‑ ¡ready ¡ Tx1 ¡ Tx2 ¡-­‑ ¡ready ¡ Tx2 ¡ Tx3 ¡-­‑ ¡ready ¡ Tx3 ¡ Tx1 ¡-­‑ ¡commit ¡ Tx3 ¡-­‑ ¡commit ¡ Shard Shard Leader Tx3 ¡-­‑ ¡abort ¡ CommitCoordinator Tx2 ¡-­‑ ¡commit ¡ member-2 43 www.opendaylight.org

  44. Managing ¡the ¡in-­‑memory ¡journal ¡ Replicated ¡To ¡All commit transaction Client leader txn txn txn follower-2 follower-1 44 www.opendaylight.org

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend