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 EE2B225602 for ; Fri, 8 Feb 2019 11:56:49 -0500 (EST) 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 B2F2JCUlwBRF for ; Fri, 8 Feb 2019 11:56:49 -0500 (EST) Received: from smtp50.i.mail.ru (smtp50.i.mail.ru [94.100.177.110]) (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 985AC2494A for ; Fri, 8 Feb 2019 11:56:49 -0500 (EST) Date: Fri, 8 Feb 2019 19:56:47 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [PATCH v2 1/2] Journal transaction boundaries Message-ID: <20190208165647.GC4588@chai> References: <7b72afb3f1a3479f1239fcbed936cc151b55f23c.1548153546.git.georgy@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7b72afb3f1a3479f1239fcbed936cc151b55f23c.1548153546.git.georgy@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: Georgy Kirichenko * Georgy Kirichenko [19/01/22 15:45]: > Append txn_id, txn_replica_id and txn_last to xrow_header structure. > txn_replica_id identifies replica where transaction was started and > txn_id identifies transaction id on that replica. As transaction id > a lsn of the first row in this transaction is used. > txn_last set to true if it is the last row in a transaction, so we > could commit transaction with last row or use additional NOP requests > with txn_last = true ans valid txn_id and txn_replica_id. > For replication all local changes moved to xrows array tail to form > a separate transaction (like autonomous transaction) because it is not > possible to replicate such transaction back to it's creator. I think we should not need txn_replica_id at all. Let's discuss. And I also thought we decided to drop txn_last? Having both txn_last and txn_id seems redundant. We could set txn_id to the last LSN of this txn, that would make txn_last unnecessary too, while giving us easy to track transaction boundaries. What about adding something like "write concern" to xrow header at the same time, so that we can select sync property individually for each transaction? > > As encoding/deconding rules assumed: > 1. txn_replica_id is encoded only if it is not equal with replica > id. This might have point because of replication trigger > 2. txn_id and txn_last are encoded only for multi-row transaction. > So if we do not have txn_id in a xstream then this means that it > is a single row transaction. > This rules provides compatibility with previous xlog handling. > -- Konstantin Osipov, Moscow, Russia, +7 903 626 22 32 http://tarantool.io - www.twitter.com/kostja_osipov