[Tarantool-patches] [PATCH 4/4] txn_limbo: add ROLLBACK processing

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Fri Jun 26 01:43:57 MSK 2020



On 26/06/2020 00:14, Vladislav Shpilevoy wrote:
>> diff --git a/src/box/txn_limbo.c b/src/box/txn_limbo.c
>> index a715a136e..c55f5bda1 100644
>> --- a/src/box/txn_limbo.c
>> +++ b/src/box/txn_limbo.c
>> @@ -191,6 +244,38 @@ txn_limbo_read_confirm(struct txn_limbo *limbo, int64_t lsn)
>> +void
>> +txn_limbo_read_rollback(struct txn_limbo *limbo, int64_t lsn)
>> +{
>> +	assert(limbo->instance_id != REPLICA_ID_NIL &&
>> +	       limbo->instance_id != instance_id);
>> +	struct txn_limbo_entry *e, *tmp;
>> +	rlist_foreach_entry_safe_reverse(e, &limbo->queue, in_queue, tmp) {
>> +		if (e->lsn < lsn)
>> +			break;
> 
> Shouldn't this be 'continue' instead of 'break'? As I understand rollback,
> we need to find entry, *from* which all the entries will be rolled back.
> Here it seems that if the oldest entry in the limbo (with the smallest LSN)
> is smaller than rollback lsn, we just won't rollback anything.

Sorry, didn't notice it is 'foreach reverse'. Not just 'foreach'.


More information about the Tarantool-patches mailing list