1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-08 14:22:09 +03:00

fix(DEC): MCOL-5637 Initialize a new bytestream before write to PS (#3118)

This commit is contained in:
Denis Khalikov
2024-02-09 22:27:14 +03:00
committed by GitHub
parent ebcf43a517
commit fcd46ab00a
2 changed files with 19 additions and 1 deletions

View File

@@ -568,6 +568,18 @@ const ByteStream DistributedEngineComm::read(uint32_t key)
return *sbs;
}
SBS DistributedEngineComm::createBatchPrimitiveCommand(ISMPACKETCOMMAND command, uint32_t uniqueID,
uint16_t size)
{
SBS bpCommand(new ByteStream(sizeof(ISMPacketHeader)));
auto* ism = (ISMPacketHeader*)bpCommand->getInputPtr();
ism->Interleave = uniqueID;
ism->Command = command;
ism->Size = size;
bpCommand->advanceInputPtr(sizeof(ISMPacketHeader));
return bpCommand;
}
void DistributedEngineComm::read_all(uint32_t key, vector<SBS>& v)
{
boost::shared_ptr<MQE> mqe;
@@ -749,7 +761,9 @@ void DistributedEngineComm::sendAcks(uint32_t uniqueID, const vector<SBS>& msgs,
{
continue;
}
writeToClient(i, msg);
// MCOL-5637 Initialize a new bytestream before send a `ACK` command to Primitive Server.
SBS ackCommand = createBatchPrimitiveCommand(BATCH_PRIMITIVE_ACK, uniqueID, 1);
writeToClient(i, ackCommand);
}
}
if (!pmAcked[localConnectionId_] && fIsExeMgr)