peloton icon indicating copy to clipboard operation
peloton copied to clipboard

Garbage collection doesn't recycle tuple slots or clean indexes in all scenarios

Open mbutrovich opened this issue 6 years ago • 0 comments

David and I completed our first comprehensive evaluation of the garbage collector. Based on the test suite we wrote here, we've identified the following tuple-related problem scenarios:

  1. Primary key constraint violation (FailedInsertPrimaryKeyTest)
  • Insert tuple (0,0), commit
  • Insert tuple (0,1), commit (primary index abort due to non-unique primary key)
  • Aborted insert still occupies a tuple slot in the table
  1. Secondary index constraint violation (FailedInsertSecondaryKeyTest)
  • Insert tuple (0,1), commit
  • Insert tuple (1,1), commit (secondary index abort due to non-unique value)
  • Aborted insert still occupies a tuple slot in the table
  1. Committed update (CommitUpdateSecondaryKeyTest)
  • Insert tuple (5,1), commit
  • Update tuple to (5,2), commit
  • Old version still present in secondary index
  1. Aborted update (AbortUpdateSecondaryKeyTest)
  • Insert tuple (0,1), commit
  • Update tuple to (0,2), abort
  • New version still present in secondary index
  1. Insert and update in same transaction, commit (CommitInsertUpdateTest)
  • Insert tuple (0,1), update to (0,2), commit
  • Old version present in both indexes, new version only present in one
  1. Insert and update in same transaction, abort (AbortInsertUpdateTest)
  • Insert tuple (0,1), update to (0,2), abort
  • Old version present in one index
  1. Delete doesn't recycle tombstone, pollutes index (CommitDeleteTest)
  • Insert tuple (0,1), commit
  • Delete tuple (0,1), commit
  • Number of recycled slots only 1 (tombstone still in table)
  • Deleted tuple still present in both indexes
  1. Update and delete in same transaction, commit (CommitUpdateDeleteTest)
  • Insert tuple (0,1), commit
  • Update to (0,2), delete, commit
  • Number of recycled slots only 1
  • Both versions of tuple present in both indexes
  1. Update and delete in same transaction, abort (AbortUpdateDeleteTest)
  • Insert tuple (0,1), commit
  • Update to (0,2), delete, abort
  • Aborted update present in both indexes
  1. Update primary key (CommitUpdatePrimaryKeyTest)
  • Insert tuple (3, 30), commit
  • Update to (5, 40), commit
  • Number of recycled slots only 1 (expect 2 due to delete, insert of PK update process)
  • Old version present in both indexes

mbutrovich avatar Apr 22 '18 16:04 mbutrovich