This repository has been archived by the owner on Feb 20, 2023. It is now read-only.
Investigate moving replication serialization to Messenger thread #1582
Labels
performance
Performance related issues or changes.
Feature Request
Summary
Currently all replication messages are serialized in the LogSerializationTask thread. This can potential slow down the LogSerializationTask. Additionally under the sync durability and async replication configuration, transactions will have to unnecessarily wait for replication messages to be serialized before committing.
The replication messages are serialized in the following places in the primary node:
Log Record Batches:
noisepage/src/replication/primary_replication_manager.cpp
Lines 80 to 86 in 30bd635
Notify OAT:
noisepage/src/replication/primary_replication_manager.cpp
Lines 107 to 111 in 30bd635
Solution
It might be beneficial to move the message serialization to the Messenger thread itself. That way the LogSerializerTask won't be slowed down by message serialization.
Currently the Messenger thread maintains a map of pending messages
noisepage/src/include/messenger/messenger.h
Line 356 in b95bf1e
noisepage/src/include/messenger/messenger.h
Lines 305 to 311 in b95bf1e
The pending message list contains many
ZmqMessage
s which hold the messages as strings.noisepage/src/include/messenger/messenger.h
Lines 37 to 98 in b95bf1e
Since we have multiple different types of messages I see two possible solutions
Personally I think 2 might be cleaner.
The text was updated successfully, but these errors were encountered: