From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 0091F6FC8F; Tue, 23 Mar 2021 18:47:15 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 0091F6FC8F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1616514436; bh=nQDplGW/VPJZZW190nC7N7nbFqqXd/F7gMElGfs530U=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=G2QFuFI1HQy9sXVotA7N/cL7sxxfUxkmLGxvoy0DXCCyRTKMlEF0mDE2K5FFbHTuz vPd8aANdD/QOI3OrXAhSeDqMlm4j7C4YiSAm5+sDIwpcXet+J032dsSS8oSXXjmFun Cha7ymppQAVGRY28hzG8ktwZOw3Ns1z4DqCovz6Y= Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 421D56FC8F for ; Tue, 23 Mar 2021 18:47:15 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 421D56FC8F Received: by mail-lf1-f53.google.com with SMTP id b83so27326898lfd.11 for ; Tue, 23 Mar 2021 08:47:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=xUJZdNZJ2XWHF4bZPdPOCMD/T/QKMTMFG0UGji3eKfc=; b=fCSzmXu1u+i0e8rKJ9QU576bQ98ymM0xFKrtVsWQoB/mTOP2HnnM2LYzp+D5SmFs67 uFlKn++X1sPwjJLg8qonnJypxt4Mh9kByawurfVRdx96M91bgY5SYrbGE0Pm3a2og8C3 V7ApFMWHwYuq8/nknMhoo9n57CnHV3svqC2BXoZ31HHmrnzXFKxaOWFrBteCZOhsjI4I NYFMqFJDxTb5dTqFgepwYChlkxXt68GOJfe6sfoslW1F9u0fro7t0gReK0R3FFjSAMaB v+rUo8r0LEPSB5GAq0dOQgXMZjFeVv6l684SvlF9KPqNZz9o+wLHS3yNwYUV63y23T6k w3cA== X-Gm-Message-State: AOAM53249kRbQ4rES8aplE0Gt3y4DG5ubqyqTv3ANr4dZff8d8xIjRQL ll1mCMI2nknxYr/CUXSIDiOaKHe7ZT8= X-Google-Smtp-Source: ABdhPJxPumyh7sqlSGaEgL5mSgVrFBDCePpem7S1SvvyF32Zlkqha4tiOBveMmoeLV1xkVxFFhKkPw== X-Received: by 2002:a05:6512:1d1:: with SMTP id f17mr2873540lfp.620.1616514433731; Tue, 23 Mar 2021 08:47:13 -0700 (PDT) Received: from grain.localdomain ([5.18.171.94]) by smtp.gmail.com with ESMTPSA id q26sm2450504ljg.90.2021.03.23.08.47.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 08:47:12 -0700 (PDT) Received: by grain.localdomain (Postfix, from userid 1000) id 868FB56017D; Tue, 23 Mar 2021 18:47:11 +0300 (MSK) To: tml Date: Tue, 23 Mar 2021 18:47:07 +0300 Message-Id: <20210323154710.1696442-1-gorcunov@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH v3 0/3] gc/xlog: delay xlog cleanup until relays are subscribed X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Cyrill Gorcunov via Tarantool-patches Reply-To: Cyrill Gorcunov Cc: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Take a look please. v2: - rebase code to the fresh master branch - keep wal_cleanup_delay option name - pass wal_cleanup_delay as an option to gc_init, so it won't be dependent on cfg engine - add comment about gc_delay_unref in plain bootstrap mode - allow to setup wal_cleanup_delay dynamically - update comment in gc_wait_cleanup and call it conditionally - declare wal_cleanup_delay as a double - rename gc.cleanup_is_paused to gc.is_paused and update output - do not show ref counter in box.info.gc() output - update documentation - move gc_delay_unref inside relay_subscribe call which runs in tx context (instead of relay's context) - update tests: - add a comment why we need a temp space on replica node - use explicit insert/snapshot operations - shrkink the number of insert/snapshot to speedup testing - use "restart" instead of stop/start pair - use wait_log helper instead of own function - add is_paused test v3: - fix changelog - rework box_check_wal_cleanup_delay, the replication_anon setting is considered only in box_set_wal_cleanup_delay, ie when config is checked and parsed, moreover the order of setup is set to be behind "replication_anon" option processing - delay cycle now considers deadline instead of per cycle calculation - use `double` type for timestamp - test update - verify `.is_paused` value - minimize number of inserts - no need to use temporary space, regular space works as well - add comments on why we should restart the master node issue https://github.com/tarantool/tarantool/issues/5806 branch gorcunov/gh-5806-xlog-gc-3 Cyrill Gorcunov (3): gc/xlog: delay xlog cleanup until relays are subscribed test: add a test for wal_cleanup_delay option test: box-tap/gc -- add test for is_paused field .../unreleased/add-wal_cleanup_delay.md | 5 + src/box/box.cc | 43 ++- src/box/box.h | 1 + src/box/gc.c | 88 ++++- src/box/gc.h | 38 +- src/box/lua/cfg.cc | 9 + src/box/lua/info.c | 4 + src/box/lua/load_cfg.lua | 5 + src/box/relay.cc | 1 + src/box/replication.cc | 2 + test/app-tap/init_script.result | 1 + test/box-tap/gc.test.lua | 3 +- test/box/admin.result | 2 + test/box/cfg.result | 4 + test/replication/gh-5806-master.lua | 8 + test/replication/gh-5806-slave.lua | 8 + test/replication/gh-5806-xlog-cleanup.result | 356 ++++++++++++++++++ .../replication/gh-5806-xlog-cleanup.test.lua | 155 ++++++++ test/unit/snap_quorum_delay.cc | 2 +- 19 files changed, 726 insertions(+), 9 deletions(-) create mode 100644 changelogs/unreleased/add-wal_cleanup_delay.md create mode 100644 test/replication/gh-5806-master.lua create mode 100644 test/replication/gh-5806-slave.lua create mode 100644 test/replication/gh-5806-xlog-cleanup.result create mode 100644 test/replication/gh-5806-xlog-cleanup.test.lua base-commit: f4e248c0c13a46beee238fbebc38ef687ef09d02 -- 2.30.2