[Tarantool-patches] [PATCH v8 3/6] limbo: gather promote tracking into a separate structure

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Thu Jul 29 01:07:44 MSK 2021


On 28.07.2021 23:57, Cyrill Gorcunov wrote:
> On Wed, Jul 28, 2021 at 11:34:43PM +0200, Vladislav Shpilevoy wrote:
>> Hi! Thanks for the patch!
>>
>> On 26.07.2021 17:34, Cyrill Gorcunov via Tarantool-patches wrote:
>>> It is needed to introduce ordered promote related data
>>> modifications in next patch.
>>
>> Why do you need this new struct? While I like the new names
>> (the old promote_greatest_term was super long), I don't see
>> any motivation to extract the members into a new struct.
>> It is still used only inside of the limbo as a member.
>>
>> I suppose this might be a leftover from the old versions of
>> the patchset. Please, try to keep these members inside of
>> the limbo like they were.
> 
> The key moment here is the locking we use for terms tracking,
> note the locking is not covering the whole limbo thus better
> to keep the lock itself inside the structure it protects I think.

Yes, the struct it protects is the limbo. Part of. I see no sense
to extract the members you protect into a new struct just because
only they are protected.

Take cbus_endpoint for instance. It has a mutex, and it is locked
to push/pop new messages into a queue. It is taken to touch the
queue. But it does not mean you need struct cbus_endpoint_queue
for that. The struct you created is very artificial, it has no
purpose outside of the limbo and there can't be multiple of these
structs. Which makes it pointless. It only complicates the patch.

It has no its own methods except 'create()', has no 'destroy()',
all its access goes through txn_limbo methods, even the lock is
stored in the limbo, not in this struct, which contradicts with
what you said above.


More information about the Tarantool-patches mailing list