{"id":20564353,"url":"https://github.com/tarantool/membership","last_synced_at":"2025-04-14T15:11:20.023Z","repository":{"id":48779928,"uuid":"100583054","full_name":"tarantool/membership","owner":"tarantool","description":"Membership library for Tarantool based on a gossip protocol","archived":false,"fork":false,"pushed_at":"2025-04-09T10:44:53.000Z","size":289,"stargazers_count":13,"open_issues_count":2,"forks_count":4,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-04-09T11:40:22.722Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tarantool.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-17T08:55:58.000Z","updated_at":"2025-04-09T10:44:58.000Z","dependencies_parsed_at":"2024-04-09T11:33:32.852Z","dependency_job_id":"654264a8-a3ab-48c6-b176-0ed8863d399c","html_url":"https://github.com/tarantool/membership","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarantool%2Fmembership","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarantool%2Fmembership/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarantool%2Fmembership/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarantool%2Fmembership/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tarantool","download_url":"https://codeload.github.com/tarantool/membership/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248904640,"owners_count":21180835,"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-11-16T04:25:55.793Z","updated_at":"2025-04-14T15:11:19.999Z","avatar_url":"https://github.com/tarantool.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://github.com/tarantool/membership/actions?query=workflow%3ATest\"\u003e\n\u003cimg src=\"https://github.com/tarantool/membership/workflows/Test/badge.svg\"\u003e\n\u003c/a\u003e\n\n# Membership library for Tarantool based on a gossip protocol\n\nThis library builds a mesh from multiple tarantool instances. The\nmesh monitors itself, helps members discover everyone else and get\nnotified about their status changes with low latency.\n\nIt is built upon the ideas from consul, or, more precisely,\nthe [SWIM](doc/swim-paper.pdf) algorithm.\n\nMembership module works over UDP protocol and can operate\neven before tarantool `box.cfg` was initialized.\n\n## Member data structure\n\nA member is represented by the table with fields:\n\n* `uri`\n* `status` is a string: `alive`, `suspect`, `dead` or `left`\n* `incarnation` which is incremented every time the instance is being\n  suspected or dead or updates its payload\n* `payload` is a table with auxiliary data, which can be used by various\n  modules to do whatever they want\n* `timestamp` is a value of `fiber.time64()` (in microseconds),\n  corresponding to the last update of status or incarnation. `timestamp`\n  is always local and does not depent on other members' clock setting.\n* `clock_delta` is a time drift between member's clock (remote) and the\n  local one (in microseconds).\n\nExample:\n\n```yaml\n---\nuri: \"localhost:33001\"\nstatus: \"alive\"\nincarnation: 1\npayload:\n    uuid: \"2d00c500-2570-4019-bfcc-ab25e5096b73\"\ntimestamp: 1522427330993752\nclock_delta: 27810\n...\n```\n\n## Reloadability\n\nMembership module supports hot-reload:\n\n```lua\npackage.loaded['membership'] = nil\nrequire('membership')\n```\n\n## Changing options\n\nYou can change membership options directly by using:\n\n```lua\nrequire(\"membership.options\")[opt_name] = opt_value\n```\n\nAvailable options:\n* Period of sending direct PINGs.\n  `PROTOCOL_PERIOD_SECONDS`, default: 1.0\n\n* Time to wait for ACK message after PING.\n  If a member does not reply within this time,\n  the indirect ping algorithm is invoked.\n  `ACK_TIMEOUT_SECONDS`, default: 0.2\n\n* Period to perform anti-entropy sync.\n  `ANTI_ENTROPY_PERIOD_SECONDS`, default: 10\n\n* Toggle producing `suspect` rumors when ping fails. Even if disabled,\n  it doesn't affect neither gossip dissemination nor other statuses\n  generation (e.g. `dead` and `non-decryptable`).\n  `SUSPICIOUSNESS`, default: true\n\n* Timeout to mark `suspect` members as `dead`.\n  `SUSPECT_TIMEOUT_SECONDS`, default: 3\n\n* Number of members to try indirectly pinging a `suspect`.\n  Denoted as `k` in [SWIM paper](swim-paper.pdf).\n  `NUM_FAILURE_DETECTION_SUBGROUPS`, default: 3\n\n* Maximum size of UPD packets to send.\n  `MAX_PACKET_SIZE`, default: 1472 (`Default-MTU (1500) - IP-Header (20) - UDP-Header (8)`)\n\n## Payload\n\nYou can add payload to any member by calling:\n\n```lua\nmembership.set_payload(key, value)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarantool%2Fmembership","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftarantool%2Fmembership","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarantool%2Fmembership/lists"}