GlusterD - Daemon refactoring

download GlusterD - Daemon refactoring

If you can't read please download the document

  • date post

  • Category


  • view

  • download


Embed Size (px)

Transcript of GlusterD - Daemon refactoring

  1. 1. Atin Mukherjee Gluster Hacker Glusterd Daemon Management Refactoring Gluster Summit May 2015
  2. 2. 12-May-2015 Gluster Summit, Barcelona Agenda Daemons managed Challenges observed Benefits of refactoring Implementation approach How to write a new daemon Future Q&A
  3. 3. 12-May-2015 Gluster Summit, Barcelona Daemons managed Gluster NFS Proactive self heal (SHD) QuotaD Rebalance Bricks SnapD BitD, Tiering (>=3.7) And many more to come
  4. 4. 12-May-2015 Gluster Summit, Barcelona Challenges Fragmented, scattered & redundant code Maintainability becomes a real challenge Pain for new developers to identify the pattern Copy paste tends to introduce more bugs
  5. 5. 12-May-2015 Gluster Summit, Barcelona Benefits from refactoring Code looks more structured Follows object styling Code reusablity No more fragmented code seggregated into different management levels Easy to understand Lesser time to write new daemons Ease of mantainance
  6. 6. 12-May-2015 Gluster Summit, Barcelona Implementation approach Follows composite structure model: Service Management Connection Management Process Management Per node/per volume daemon
  7. 7. 12-May-2015 Gluster Summit, Barcelona Service Management Service can have its own customized data Default glusterd_svc_t structure Name of the daemon service Connection object Process object Function pointer of svc_manager, start & stop Status of the daemon (online/offline) Methods init (), reconfigure (), svcs_manager (), svcs_stop (), svcs_reconfigure (),
  8. 8. 12-May-2015 Gluster Summit, Barcelona Connection Management Manages the rpc connection Default glusterd_conn_t structure rpc connection socket path frame-timeout (default to 600s) rpc notify function pointer Methods init (), connect (), disconnect (), term ()
  9. 9. 12-May-2015 Gluster Summit, Barcelona Process Management Place holder to keep all the process related information glusterd_proc_t process_name pidfile logdir logfile volfile, volfileserver, volfileid Methods init (), proc_stop () , is_proc_running ()
  10. 10. 12-May-2015 Gluster Summit, Barcelona How to write a new daemon Per node daemon Add your service (glusterd_svc_t) in glusterd_conf_t Init your service in glusterd_svc_init_all () Add xxx_svc_manager () in glusterd_svcs_manager (), same for reconfigure & stop as well. Invoke xxx_svc_manager () wherever required (eg : volume start/stop)
  11. 11. 12-May-2015 Gluster Summit, Barcelona How to write a new daemon (ii) Per volume daemon Add your service (glusterd_svc_t) in glusterd_volinfo_t Trigger is on a volume configuration change Init your service when the volume is created Need to be careful while restoring & importing volumes Invoke xxx_svc_manager () wherever required (eg : volume start/stop)
  12. 12. 12-May-2015 Gluster Summit, Barcelona Future Rebalance, brick daemons need to be refactored Introduce list of service APIs
  13. 13. 12-May-2015 Gluster Summit, Barcelona Q&A