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 3A1956EC55; Mon, 12 Jul 2021 11:23:33 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 3A1956EC55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1626078213; bh=8gRE9oyb5lUlPJKEmaVv8Y4ncrE63fetW4ZXSQSHxn8=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=mb7cpnrzXRa5ZzbBTz7mLqbOSMFyRV90ivh9nFjSwOgtKGkgt9HpUaqsIZC2WQfIP x/qKfSi+r6+QOMI3RDinsC/kPBFSD3+4MkqnaIT08KctJElhgtFjSh0CG8OwAr++MU QpXxWmbE7W7tDWggVgJAtOkRsdz2BAgO45FE4KCE= Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) (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 610576EC55 for ; Mon, 12 Jul 2021 11:23:32 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 610576EC55 Received: by mail-lj1-f179.google.com with SMTP id r16so22838818ljk.9 for ; Mon, 12 Jul 2021 01:23:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=g8m3yaH17Nd1Uabrmh062pc7iPN/uSZV/mVtr2yrqhk=; b=n5ux8COLkozHEnBvtKaJiTP8Ebr92474mcvuzxhKh0KxC9kj6U8mfYaUS7tjEtVt0j Gc8/k9S/x5t8/myNpq1PiK3q8uRlvuOhqA1b82KJDTA65OrthQ1+JSQal7HS+D03b27p 0/Ksb805fJDNhWlkQcqFEuOXeuhaFYhyDoNJC2T8yfN0RU6i8K2Uurrj79r/vdLjIARX FxrsyzvRMpDUDGkXGsSEWtiy90NS8mMXZtUPIAu+UTwdAznCWXJfLH2r93KZ/ASiRJTm vcMpw1lOHmZFu4y7bsoOCLg6itlvG3PeeMJSk2r+B/4ncL1ePeBnl5lAt6rY3lQ8uc8q ZTSw== X-Gm-Message-State: AOAM533a7Jk8GsTMW6TPw2oVu0uf+vhNT4lZPec2scRKpQ1GphRn0f7O Tpq0c7Eg1eFtf07MW85qR5xSWvAfM3v8dw== X-Google-Smtp-Source: ABdhPJwtaGUUBAKy5azofQG7MNpaZCX+Hvc/cfqFjVsbX6OEKeHeIqdRrJ8dTOQ+w7Mm7emMTXwtsA== X-Received: by 2002:a2e:a41c:: with SMTP id p28mr6042104ljn.461.1626078211302; Mon, 12 Jul 2021 01:23:31 -0700 (PDT) Received: from grain.localdomain ([5.18.199.94]) by smtp.gmail.com with ESMTPSA id a16sm623632ljk.6.2021.07.12.01.23.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 01:23:30 -0700 (PDT) Received: by grain.localdomain (Postfix, from userid 1000) id B88C65A001E; Mon, 12 Jul 2021 11:23:29 +0300 (MSK) Date: Mon, 12 Jul 2021 11:23:29 +0300 To: Vladislav Shpilevoy , Serge Petrenko Cc: tml Message-ID: References: <20210710222803.253251-1-gorcunov@gmail.com> <187d1ae2-99cb-50d4-d5b4-18aa6c5f5546@tarantool.org> <36639f07-5c56-5c94-d563-0862135d0ea9@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.0.7 (2021-05-04) Subject: Re: [Tarantool-patches] [PATCH] limbo: introduce request processing hooks 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 Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" On Mon, Jul 12, 2021 at 11:12:12AM +0300, Cyrill Gorcunov wrote: > On Mon, Jul 12, 2021 at 10:04:56AM +0200, Vladislav Shpilevoy wrote: > > > > > > And if we filter before the WAL write, we need the second vclock, which > > > Cyrill has introduced. > > > > Why do you need a second vclock? Why can't you just filter by the > > existing vclock and update it after WAL write like now? > > Because the phases are no longer atomic. We can pass "filter" stage, > update our terms, but then WAL process failed (it doesn't matter for > what reason, maybe single disk write failure) so we have to revert > former term value back so the client will retry the operation and > resend us the PROMOTE. Here is kind of top-view over the code (an interesting snippet is of course apply_synchro_row routine). Current code apply_synchro_row journal_write apply_synchro_row_cb txn_limbo_apply - update terms map - ignore bad promotes Thus we just wrote bad promote into our WAL. New approach apply_synchro_row txn_limbo_apply(LIMBO_OP_FILTER) - update terms_infly if allowed - exit with error if prohibited journal_write - apply_synchro_row_cb if everything is fine - journal write failed txn_limbo_apply(LIMBO_OP_ERROR) restore terms_infly to previous _written_ value Cyrill