From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp39.i.mail.ru (smtp39.i.mail.ru [94.100.177.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 3E69B469719 for ; Wed, 19 Feb 2020 11:46:01 +0300 (MSK) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.40.2.2.4\)) From: Serge Petrenko In-Reply-To: <716db588-d891-7985-a6d8-024f3902a22f@tarantool.org> Date: Wed, 19 Feb 2020 11:46:00 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: References: <97f37279955ebc29e899164cc1364e6a0aea0f9b.1581630406.git.sergepetrenko@tarantool.org> <716db588-d891-7985-a6d8-024f3902a22f@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH v2 3/4] wal: wart when trying to write a record with a broken lsn List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy , Alexander Turenko , Konstantin Osipov Cc: tarantool-patches@dev.tarantool.org > 19 =D1=84=D0=B5=D0=B2=D1=80. 2020 =D0=B3., =D0=B2 00:15, Vladislav = Shpilevoy =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0= =D0=BB(=D0=B0): >=20 > Hi! Thanks for the fixes! >=20 >> diff --git a/src/box/wal.c b/src/box/wal.c >> index f8ee2b7d8..a87aedf1d 100644 >> --- a/src/box/wal.c >> +++ b/src/box/wal.c >> @@ -955,14 +955,16 @@ wal_assign_lsn(struct vclock *vclock_diff, = struct vclock *base, >> if (diff <=3D vclock_get(vclock_diff, >> (*row)->replica_id)) { >> say_crit("Attempt to write a broken LSN to WAL:" >> - " replica id: %d, committed lsn: %d," >> + " replica id: %d, confirmed lsn: %d," >> " new lsn %d", (*row)->replica_id, >> vclock_get(base, (*row)->replica_id) + >> vclock_get(vclock_diff, >> (*row)->replica_id), >> (*row)->lsn); >> +assert(0); >=20 > Ok. Lets then use assert(false) at least. We don't normally use > integers as booleans. Thanks for review! Fixed. diff --git a/src/box/wal.c b/src/box/wal.c index a87aedf1d..b08d62b29 100644 --- a/src/box/wal.c +++ b/src/box/wal.c @@ -961,7 +961,7 @@ wal_assign_lsn(struct vclock *vclock_diff, struct = vclock *base, vclock_get(vclock_diff, (*row)->replica_id), (*row)->lsn); - assert(0); + assert(false); } else { vclock_follow(vclock_diff, = (*row)->replica_id, diff); } -- Serge Petrenko sergepetrenko@tarantool.org