1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-27 21:01:50 +03:00

Revert "feat(BRM) MCOL-5555 Reduce a number of direct writes to BRM journal/tablelocks files" (#2972)

This reverts commit 02114b5b7c.
This commit is contained in:
Leonid Fedorov
2023-09-26 05:52:59 +03:00
committed by GitHub
parent 02114b5b7c
commit 3be86a7131
5 changed files with 11 additions and 98 deletions

View File

@ -70,21 +70,14 @@ void TableLockServer::save()
if (!out)
throw runtime_error("TableLockServer::save(): could not open save file");
uint32_t bufferSize = 4;
for (const auto& lock : locks)
bufferSize += lock.second.getInternalSize();
std::unique_ptr<char[]> buffer(new char[bufferSize]);
uint32_t offset = 0;
std::memcpy(&buffer[offset], (char*)&count, 4);
offset += 4;
out->write((char*)&count, 4);
for (it = locks.begin(); it != locks.end(); ++it)
{
if (!out)
throw runtime_error("TableLockServer::save(): could not write save file");
it->second.serialize(buffer.get(), offset);
it->second.serialize(out.get());
}
}