Stopgap (inefficient, but possibly correct) fix for the arraylist kludgieness.
This commit is contained in:
parent
c34617fa16
commit
48cdffe4d4
3 changed files with 16 additions and 2 deletions
|
@ -168,7 +168,18 @@ static compensated_function int TarrayListExtendInternal(int xid, recordid rid,
|
|||
DEBUG("block %d\n", i);
|
||||
/* We used to call OPERATION_INITIALIZE_FIXED_PAGE on each page in current indirection block. */
|
||||
tmp.slot = i + FIRST_DATA_PAGE_OFFSET;
|
||||
|
||||
/* Iterate over the (large number) of new blocks, clearing their contents */
|
||||
/* @todo XXX arraylist generates N log entries initing pages.
|
||||
It should generate 1 entry. (Need better LSN handling first.)*/
|
||||
{
|
||||
recordid newpage;
|
||||
newpage.slot = 0;
|
||||
newpage.size = tlp.size;
|
||||
for(int i = newFirstPage; i < newFirstPage + blockSize; i++) {
|
||||
newpage.page = i;
|
||||
TupdateRaw(xid, newpage, 0, OPERATION_FIXED_PAGE_ALLOC);
|
||||
}
|
||||
}
|
||||
TupdateRaw(xid, tmp, &newFirstPage, op);
|
||||
DEBUG("Tset: {%d, %d, %d} = %d\n", tmp.page, tmp.slot, tmp.size, newFirstPage);
|
||||
}
|
||||
|
|
|
@ -211,6 +211,7 @@ const byte * stasis_record_read_begin(int xid, Page * p, recordid rid) {
|
|||
if(!recordWarnedAboutPageTypeKludge) {
|
||||
recordWarnedAboutPageTypeKludge = 1;
|
||||
printf("page.c: MAKING USE OF TERRIBLE KLUDGE AND IGNORING ASSERT FAILURE! FIX ARRAY LIST ASAP!!!\n");
|
||||
abort();
|
||||
}
|
||||
}
|
||||
return page_impls[page_type].recordRead(xid, p, rid);
|
||||
|
@ -222,6 +223,7 @@ byte * stasis_record_write_begin(int xid, Page * p, recordid rid) {
|
|||
if(!recordWarnedAboutPageTypeKludge) {
|
||||
recordWarnedAboutPageTypeKludge = 1;
|
||||
printf("page.c: MAKING USE OF TERRIBLE KLUDGE AND IGNORING ASSERT FAILURE! FIX ARRAY LIST ASAP!!!\n");
|
||||
abort()
|
||||
}
|
||||
}
|
||||
return page_impls[page_type].recordWrite(xid, p, rid);
|
||||
|
|
|
@ -13,7 +13,7 @@ int stasis_fixed_records_per_page(size_t size) {
|
|||
void stasis_fixed_initialize_page(Page * page, size_t size, int count) {
|
||||
assertlocked(page->rwlatch);
|
||||
// XXX fixed page asserts it's been given an UNINITIALIZED_PAGE... Why doesn't that crash?
|
||||
assert(*stasis_page_type_ptr(page) == UNINITIALIZED_PAGE);
|
||||
// assert(*stasis_page_type_ptr(page) == UNINITIALIZED_PAGE);
|
||||
*stasis_page_type_ptr(page) = FIXED_PAGE;
|
||||
*recordsize_ptr(page) = size;
|
||||
assert(count <= stasis_fixed_records_per_page(size));
|
||||
|
@ -28,6 +28,7 @@ static void checkRid(Page * page, recordid rid) {
|
|||
checkRidWarnedAboutUninitializedKludge = 1;
|
||||
printf("KLUDGE detected in checkRid. Fix it ASAP\n");
|
||||
fflush(stdout);
|
||||
abort();
|
||||
}
|
||||
stasis_fixed_initialize_page(page, rid.size, stasis_fixed_records_per_page(rid.size));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue