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 1B18C2544B for ; Fri, 25 May 2018 14:15:40 -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 ujMWEMC-Tr95 for ; Fri, 25 May 2018 14:15:40 -0400 (EDT) Received: from smtp62.i.mail.ru (smtp62.i.mail.ru [217.69.128.42]) (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 48DAA249F3 for ; Fri, 25 May 2018 14:15:39 -0400 (EDT) From: Vladislav Shpilevoy Subject: [tarantool-patches] [PATCH v3 1/1] rfc: describe box.ctl.promote protocol Date: Fri, 25 May 2018 21:15:36 +0300 Message-Id: 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 --- 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 | 211 ++++++++++++++++++++++++++++++++++ doc/rfc/3055-box_ctl_promote_img1.svg | 2 + 2 files changed, 213 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..2cd845d91 --- /dev/null +++ b/doc/rfc/3055-box_ctl_promote.md @@ -0,0 +1,211 @@ +# 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 =