From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id EAE7D2D7B8 for ; Wed, 18 Apr 2018 16:52:53 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GLo4beu84Dw8 for ; Wed, 18 Apr 2018 16:52:53 -0400 (EDT) Received: from smtp33.i.mail.ru (smtp33.i.mail.ru [94.100.177.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 1CD1E2D79D for ; Wed, 18 Apr 2018 16:52:52 -0400 (EDT) From: Vladislav Shpilevoy Subject: [tarantool-patches] [PATCH 1/1] rfc: describe box.ctl.promote protocol Date: Wed, 18 Apr 2018 23:52:48 +0300 Message-Id: <73bf7e34f1b13c9fbbe55bda81cb088991c3ad2c.1524084675.git.v.shpilevoy@tarantool.org> Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: tarantool-patches@freelists.org Cc: kostja@tarantool.org Part of #3055 --- Original: https://github.com/tarantool/tarantool/blob/gh-3055-box-ctl-promote-rfc/doc/rfc/3055-box_ctl_promote.md Branch: https://github.com/tarantool/tarantool/tree/gh-3055-box-ctl-promote-rfc Issue: https://github.com/tarantool/tarantool/issues/3055 doc/rfc/3055-box_ctl_promote.md | 280 ++++++++++++++++++++++++++++++++++ doc/rfc/3055-box_ctl_promote_img1.svg | 2 + 2 files changed, 282 insertions(+) create mode 100644 doc/rfc/3055-box_ctl_promote.md create mode 100644 doc/rfc/3055-box_ctl_promote_img1.svg diff --git a/doc/rfc/3055-box_ctl_promote.md b/doc/rfc/3055-box_ctl_promote.md new file mode 100644 index 000000000..9ce233203 --- /dev/null +++ b/doc/rfc/3055-box_ctl_promote.md @@ -0,0 +1,280 @@ +# Replicaset master promotion + +* **Status**: In progress +* **Start date**: 02-03-2018 +* **Authors**: Vladislav Shpilevoy @Gerold103 \, +Konstantin Osipov @kostja \ +* **Issues**: [#3055](https://github.com/tarantool/tarantool/issues/3055), +[#2625](https://github.com/tarantool/tarantool/issues/2625) + +## Summary + +Replicaset master promotion is a procedure of atomic making one slave be new +master, and an old master be slave in a fullmesh master-slave replicaset. Master +is a replica in read-write mode. Slave is a replica in read-only mode. + +Master promotion has API: +```Lua +-- +-- Called on a slave promotes its role to master, demoting an old +-- one to slave. Called on a master returns an error. +-- @param opts Options. +-- * timeout - the time in which a promotion must be +-- finished; +-- * quorum - before an old master demotion its data must +-- be synced with no less than quorum slave count, +-- including the being promoted one; +-- * force - in any case make the current slave be master +-- even if an old one is unavailable, or quorum is not +-- satisfied, or another promotion is detected. +-- +-- @retval true Promotion is started. +-- @retval nil, error Can not start promotion. +-- +box.ctl.promote(opts) + +-- +-- Status of the latest finished or the currently working +-- promotion round. +-- @retval nil Promote() was not called since the instance has +-- been started, or it was started on another instance, +-- that could not sent promotion info to the current +-- instance. +-- @retval status A table with the format: +-- { +-- round_uuid = , +-- promote_uuid = , +-- demote_uuid = , +-- state = , +-- step_number = , +-- error = , +-- is_finished = , +-- start_ts =