mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 22:03:03 +01:00
Splitted the undo log into two parts: in-memory one for initial undo items (but they're much more dense now) and on-disk (cached up to TempSpaceLimit) one for full record versions (used in update-in-place).
This dramatically reduces the memory usage for bulk updates, thus solving CORE-1575 (serious memory bug on multiple update a table in a single transaction) and CORE-1477 (Avoiding excessive memory consumption by undo-log after series of updates) and predicting out-of-memory conditions that could often lead to record-level corruptions.
This commit is contained in:
parent
8edd7733d4
commit
1a943d1990
@ -217,7 +217,7 @@ void BLB_close(thread_db* tdbb, Jrd::blb* blob)
|
||||
{
|
||||
blob->blb_temp_size += BLP_SIZE;
|
||||
jrd_tra* transaction = blob->blb_transaction;
|
||||
TempSpace* tempSpace = transaction->getTempSpace();
|
||||
TempSpace* const tempSpace = transaction->getBlobSpace();
|
||||
|
||||
blob->blb_temp_offset = tempSpace->allocateSpace(blob->blb_temp_size);
|
||||
tempSpace->write(blob->blb_temp_offset,
|
||||
@ -1310,7 +1310,7 @@ blb* BLB_open2(thread_db* tdbb,
|
||||
|
||||
if (new_blob->blb_temp_size > 0)
|
||||
{
|
||||
transaction->getTempSpace()->read(new_blob->blb_temp_offset,
|
||||
transaction->getBlobSpace()->read(new_blob->blb_temp_offset,
|
||||
blob->getBuffer(), new_blob->blb_temp_size);
|
||||
}
|
||||
|
||||
@ -2641,7 +2641,7 @@ static void release_blob(blb* blob, const bool purge_flag)
|
||||
|
||||
if ((blob->blb_flags & BLB_temporary) && blob->blb_temp_size > 0)
|
||||
{
|
||||
blob->blb_transaction->getTempSpace()->releaseSpace(
|
||||
blob->blb_transaction->getBlobSpace()->releaseSpace(
|
||||
blob->blb_temp_offset, blob->blb_temp_size);
|
||||
}
|
||||
|
||||
|
@ -2010,7 +2010,7 @@ RecordNumber DPM_store_blob(thread_db* tdbb, blb* blob, Record* record)
|
||||
{
|
||||
if (blob->blb_temp_size > 0)
|
||||
{
|
||||
blob->blb_transaction->getTempSpace()->read(
|
||||
blob->blb_transaction->getBlobSpace()->read(
|
||||
blob->blb_temp_offset, buffer.getBuffer(blob->blb_temp_size),
|
||||
blob->blb_temp_size);
|
||||
q = buffer.begin();
|
||||
|
Loading…
Reference in New Issue
Block a user