When a mutation is written to the commitlog, a rp_handle object is returned which keeps a reference to commitlog segment. A segment is "dirty" when its reference count is not zero, otherwise it is "clean". When commitlog object is being destroyed, a warning is being printed for every dirty segment. On the other hand, clean segments are deleted. In case of standard mutation writing path, the rp_handle moves responsibility for releasing the reference to the memtable to which the mutation is written. When the memtable is flushed to disk, all references accumulated in the memtable are released. In this context, it makes sense to warn about dirty segments, because such segments contain mutations that are not written to sstables, and need to be replayed. However, hinted handoff uses a different workflow - it recreates a commitlog object periodically. When a hint is written to commitlog, the rp_handle reference is not released, so that segments with hints are not deleted when destroying the commitlog. When commitlog is created again, we get a list of saved segments with hints that we can try to send at a later time. Although this is intended behavior, now that releasing the hints commitlog is done properly, it causes the mentioned warning to periodically appear in the logs. This patch adds a parameter for the commitlog that allows to disable this warning. It is only used when creating hinted handoff commitlogs.
87 KiB
87 KiB