Regions are 1 offset;iterator was totally broken.
This commit is contained in:
parent
17d4f95d03
commit
043b9a7a01
1 changed files with 6 additions and 5 deletions
|
@ -105,7 +105,7 @@ int TregionReadBoundaryTag(int xid, pageid_t page, boundary_tag* tag) {
|
||||||
pthread_mutex_lock(®ion_mutex);
|
pthread_mutex_lock(®ion_mutex);
|
||||||
assert(0 == holding_mutex);
|
assert(0 == holding_mutex);
|
||||||
holding_mutex = pthread_self();
|
holding_mutex = pthread_self();
|
||||||
int ret = readBoundaryTag(xid,page,tag);
|
int ret = readBoundaryTag(xid,page-1,tag);
|
||||||
holding_mutex = 0;
|
holding_mutex = 0;
|
||||||
pthread_mutex_unlock(®ion_mutex);
|
pthread_mutex_unlock(®ion_mutex);
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -173,16 +173,17 @@ int TregionNextBoundaryTag(int xid, pageid_t* pid, boundary_tag * tag, int type)
|
||||||
holding_mutex = pthread_self();
|
holding_mutex = pthread_self();
|
||||||
|
|
||||||
|
|
||||||
int ret = readBoundaryTag(xid, *pid, tag);
|
int ret = readBoundaryTag(xid, *pid-1, tag);
|
||||||
if(ret) {
|
if(ret) {
|
||||||
while(1) {
|
while(1) {
|
||||||
if(tag->size == UINT32_MAX) {
|
if(tag->size == UINT32_MAX) {
|
||||||
ret = 0;
|
ret = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
*pid += tag->size;
|
*pid += tag->size+1;
|
||||||
ret = readBoundaryTag(xid,*pid, tag);
|
int succ = readBoundaryTag(xid,*pid-1, tag);
|
||||||
assert(ret); // detected boundary tag corruption.
|
assert(succ); // detect missing boundary tags
|
||||||
|
DEBUG("tag status = %d\n",tag->status);
|
||||||
if(tag->status == REGION_ZONED && ((!type) || (tag->allocation_manager == type))) {
|
if(tag->status == REGION_ZONED && ((!type) || (tag->allocation_manager == type))) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue