From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 72AF4431780 for ; Fri, 14 Aug 2020 01:18:00 +0300 (MSK) Received: by mail-lj1-f194.google.com with SMTP id v12so7885684ljc.10 for ; Thu, 13 Aug 2020 15:18:00 -0700 (PDT) Date: Fri, 14 Aug 2020 01:17:57 +0300 From: Cyrill Gorcunov Message-ID: <20200813221757.GB2074@grain> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Tarantool-patches] [PATCH 1/1] xrow: introduce struct synchro_request List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy Cc: tarantool-patches@dev.tarantool.org On Thu, Aug 13, 2020 at 11:58:20PM +0200, Vladislav Shpilevoy wrote: ... > +txn_limbo_write_synchro(struct txn_limbo *limbo, uint32_t type, int64_t lsn) > { > assert(lsn > 0); > > + struct synchro_request req; > + req.type = type; > + req.replica_id = limbo->instance_id; > + req.lsn = lsn; > + Vlad, while you're at this code, could we please use designated initialization from the very beginning, ie struct synchro_request req = { .type = type, .replica_id = limbo->instance_id, .lsn = lsn, }; (the alignment is up to you though). Such initialization won't allow a bug to happen when we get a structure extension and other non updated fields will be zeroified. Other that this looks great!