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 6095E6FC86; Wed, 24 Mar 2021 19:38:06 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 6095E6FC86 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1616603886; bh=62wUPB/QXi3MAUEYB5UaAwlnLhVyNS5TLlcVzDglfyo=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=vGQid+AquUx+0NBlqyB/sWAfybUSUQ4xbJj9Y5t5cFkD3NjQiCKFZlICDNaZfI0Qf 5ZbaGCmVhHetoZp3PqNP/VyNgHPyh96DF69ozOWlb43vKq0mujE3ZmVXCfcsstj8s1 SwpT3TiiBT+g1j6gjv80vmqG/YIO0qIJotJvKxrs= Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (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 9596B6FC86 for ; Wed, 24 Mar 2021 19:38:04 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 9596B6FC86 Received: by mail-lj1-f170.google.com with SMTP id u4so31019661ljo.6 for ; Wed, 24 Mar 2021 09:38:04 -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=TvlTy2AfAlSgyiIyESLj4OwNvnPn4xuh4EWX8ltr7Rw=; b=Lru5CFBWu3/gQS1MS+hf6l1v34hMC+kQ7wextJYQRushqgmbVQzX/NKQVBARZ62SNg SKpRUiyz/CiHsS1mjKsR/B1S9lJagSlH63FsISGH5kH1hIl3fu4Jgr2jP5pJiJU05cDi IpLolGFJzMfIT3OZcyKMnmnof3BO03+lCpBIJvM6nXZyOG8lSHrZxjTZJI3Tt2EthrGH q0lrSJtgAg6cVO1fKFJR6kLISqs9xEwFKsmRWkHC5q8RIzeaU1F1VBddrxwwZp+JFVvs V4c66Ks6ebLEr7AlzIIyohIvInipKKKHeesupKpw9qs2EhE7f1Qx1F35gMV02AaiIkE3 SD6g== X-Gm-Message-State: AOAM530LVEnCbPM4wKiydH6bZygnHx5A5L80/b/1QpqItbZ6hxwL5V2p zEUkFHPgPtqXn3WS4OGuOnkETrSajzw= X-Google-Smtp-Source: ABdhPJyq7GjNA3TFnk549hMAGtb5+z4GbusTbYbU+yG8cjJrgHtQMU6HibPEZu5SBpKaCFK9+rsz6g== X-Received: by 2002:a2e:7a11:: with SMTP id v17mr2710560ljc.403.1616603883033; Wed, 24 Mar 2021 09:38:03 -0700 (PDT) Received: from grain.localdomain ([5.18.171.94]) by smtp.gmail.com with ESMTPSA id v2sm366454ljg.89.2021.03.24.09.38.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Mar 2021 09:38:02 -0700 (PDT) Received: by grain.localdomain (Postfix, from userid 1000) id 4307F560179; Wed, 24 Mar 2021 19:38:00 +0300 (MSK) To: tml Date: Wed, 24 Mar 2021 19:37:56 +0300 Message-Id: <20210324163759.1900553-1-gorcunov@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH v4 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 v4: - drop argument from gc_init(), since we're configuring delay value from load_cfg.lua script there is no need to read the delay early, simply start gc paused and unpause it on demand - move unpause message to main wait cycle - test update: - verify tests and fix replication/replica_rejoin since it waits for xlogs to be cleaned up too early - use 10 seconds for XlogGapError instead of 0.1 second, this is a common deadline value issue https://github.com/tarantool/tarantool/issues/5806 branch gorcunov/gh-5806-xlog-gc-4 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 | 41 ++ src/box/box.h | 1 + src/box/gc.c | 85 ++++- src/box/gc.h | 36 ++ 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/replication/replica_rejoin.result | 16 + test/replication/replica_rejoin.test.lua | 9 + 20 files changed, 746 insertions(+), 5 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