[Tarantool-patches] [PATCH v2 3/4] wal: wart when trying to write a record with a broken lsn
Serge Petrenko
sergepetrenko at tarantool.org
Wed Feb 19 11:46:00 MSK 2020
> 19 февр. 2020 г., в 00:15, Vladislav Shpilevoy <v.shpilevoy at tarantool.org> написал(а):
>
> Hi! Thanks for the fixes!
>
>> 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 <= 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);
>
> 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 at tarantool.org
More information about the Tarantool-patches
mailing list