Skip to content

Commit

Permalink
Splitted the undo log into two parts: in-memory one for initial undo …
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
dyemanov committed Oct 14, 2008
1 parent 8edd773 commit 1a943d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/jrd/blb.cpp
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion src/jrd/dpm.epp
Expand Up @@ -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();
Expand Down

0 comments on commit 1a943d1

Please sign in to comment.