{"id":13522929,"url":"https://corosync.github.io/corosync/","last_synced_at":"2025-03-31T23:32:38.365Z","repository":{"id":37663073,"uuid":"1790677","full_name":"corosync/corosync","owner":"corosync","description":"The Corosync Cluster Engine","archived":false,"fork":false,"pushed_at":"2025-03-26T09:08:29.000Z","size":24030,"stargazers_count":1128,"open_issues_count":46,"forks_count":211,"subscribers_count":97,"default_branch":"main","last_synced_at":"2025-03-27T14:02:48.450Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://corosync.github.io/corosync/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/corosync.png","metadata":{"files":{"readme":"README.recovery","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-05-23T23:07:24.000Z","updated_at":"2025-03-26T10:54:49.000Z","dependencies_parsed_at":"2023-02-14T19:16:31.825Z","dependency_job_id":"83b0a7ee-6aaa-4afa-b520-d0c0e71b02a7","html_url":"https://github.com/corosync/corosync","commit_stats":null,"previous_names":[],"tags_count":100,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corosync%2Fcorosync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corosync%2Fcorosync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corosync%2Fcorosync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corosync%2Fcorosync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/corosync","download_url":"https://codeload.github.com/corosync/corosync/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246558108,"owners_count":20796696,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T06:00:53.797Z","updated_at":"2025-03-31T23:32:33.349Z","avatar_url":"https://github.com/corosync.png","language":"C","funding_links":[],"categories":["Tools for Self-Hosting"],"sub_categories":["Development"],"readme":"SYNCHRONIZATION ALGORITHM:\n-------------------------\nThe synchronization algorithm is used for every service in corosync to\nsynchronize state of the system.\n\nThere are 4 events of the synchronization algorithm.  These events are in fact\nfunctions that are registered in the service handler data structure.  They\nare called by the synchronization system whenever a network partitions or\nmerges.\n\ninit:\nWithin the init event a service handler should record temporary state variables\nused by the process event.\n\nprocess:\nThe process event is responsible for executing synchronization.  This event\nwill return a state as to whether it has completed or not.  This allows for\nsynchronization to be interrupted and recontinue when the message queue buffer\nis full.  The process event will be called again by the synchronization service\nif requested to do so by the return variable returned in process.\n\nabort:\nThe abort event occurs when during synchronization a processor failure occurs.\n\nactivate:\nThe activate event occurs when process has returned no more processing is\nnecessary for any node in the cluster and all messages originated by process\nhave completed.\n\nCHECKPOINT SYNCHRONIZATION ALGORITHM:\n------------------------------------\nThe purpose of the checkpoint synchronization algorithm is to synchronize\ncheckpoints after a partition or merge of two or more partitions.  The\nsecondary purpose of the algorithm is to determine the cluster-wide reference\ncount for every checkpoint.\n\nEvery cluster contains a group of checkpoints.  Each checkpoint has a\ncheckpoint name and checkpoint number.  The number is used to uniquely reference\nan unlinked but still open checkpoint in the cluster.\n\nEvery checkpoint contains a reference count which is used to determine when\nthat checkpoint may be released.  The algorithm rebuilds the reference count\ninformation each time a partition or merge occurs.\n\nlocal variables\nmy_sync_state may have the values SYNC_CHECKPOINT, SYNC_REFCOUNT\nmy_current_iteration_state contains any data used to iterate the checkpoints\n\tand sections.\ncheckpoint data\n\trefcount_set contains reference count for every node consisting of\n\tnumber of opened connections to checkpoint and node identifier\n\trefcount contains a summation of every reference count in the refcount_set\n\npseudocode executed by a processor when the synchronization service calls\nthe init event\n\tcall process_checkpoints_enter\n\npseudocode executed by a processor when the synchronization service calls\nthe process event in the SYNC_CHECKPOINT state\n\tif lowest processor identifier of old ring in new ring\n\t\ttransmit checkpoints or sections starting from my_current_iteration_state\n\tif all checkpoints and sections could be queued\n\t\tcall sync_refcounts_enter\n\telse\n\t\trecord my_current_iteration_state\n\n\trequire process to continue\n\npseudocode executed by a processor when the synchronization service calls\nthe process event in the SYNC_REFCOUNT state\n\tif lowest processor identifier of old ring in new ring\n\t\ttransmit checkpoint reference counts\n\tif all checkpoint reference counts could be queued\n\t\trequire process to not continue\n\telse\n\t\trecord my_current_iteration_state for checkpoint reference counts\n\nsync_checkpoints_enter:\n\tmy_sync_state = SYNC_CHECKPOINT\n\tmy_current_iteration_state set to start of checkpoint list\n\nsync_refcounts_enter:\n\tmy_sync_state = SYNC_REFCOUNT\n\non event receipt of foreign ring id message\n\tignore message\n\npseudocode executed on event receipt of checkpoint update\n\tif checkpoint exists in temporary storage\n\t\tignore message\n\telse\n\t\tcreate checkpoint\n\t\treset checkpoint refcount array\n\npseudocode executed on event receipt of checkpoint section update\n\tif checkpoint section exists in temporary storage\n\t\tignore message\n\telse\n\t\tcreate checkpoint section\n\npseudocode executed on event receipt of reference count update\n\tupdate temporary checkpoint data storage reference count set by adding\n\tany reference counts in the temporary message set to those from the\n\tevent\n\tupdate that checkpoint's reference count\n\tset the global checkpoint id to the current checkpoint id + 1 if it\n\twould increase the global checkpoint id\n\npseudocode called when the synchronization service calls the activate event:\nfor all checkpoints\n\tfree all previously committed checkpoints and sections\n\tconvert temporary checkpoints and sections to regular sections\ncopy my_saved_ring_id to my_old_ring_id\n\npseudocode called when the synchronization service calls the abort event:\n\tfree all temporary checkpoints and temporary sections\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/corosync.github.io%2Fcorosync%2F","html_url":"https://awesome.ecosyste.ms/projects/corosync.github.io%2Fcorosync%2F","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/corosync.github.io%2Fcorosync%2F/lists"}