diff options
author | David Young <dyoung@hdfgroup.org> | 2020-06-11 22:02:22 (GMT) |
---|---|---|
committer | David Young <dyoung@hdfgroup.org> | 2020-06-11 22:02:22 (GMT) |
commit | b5d304acf60c5e650b87c28c0be0dd50245611af (patch) | |
tree | 2ffc3d6242ecc8b2e3b1385eee728088e9228202 /src/H5Dbtree.c | |
parent | ff8f7e6da4a9d266dcf4b7c5a97a7366ec440bbe (diff) | |
download | hdf5-b5d304acf60c5e650b87c28c0be0dd50245611af.zip hdf5-b5d304acf60c5e650b87c28c0be0dd50245611af.tar.gz hdf5-b5d304acf60c5e650b87c28c0be0dd50245611af.tar.bz2 |
Extract a subroutine that closes chunk indices,
H5D__chunk_index_close(), and call it in H5D__chunk_read() after reading
a chunked dataset. In this way, indices based on extensible arrays and
v2 B-trees do not leave pinned/tagged entries in the metadata cache that
we cannot evict/refresh when we load changes from the shadow file.
Make some changes to the v1 B-tree code that set the pointer to the
closed B-tree to NULL and, further, tolerate a NULL pointer where
previously that was impossible.
Diffstat (limited to 'src/H5Dbtree.c')
-rw-r--r-- | src/H5Dbtree.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/H5Dbtree.c b/src/H5Dbtree.c index 098e01b..996c89e 100644 --- a/src/H5Dbtree.c +++ b/src/H5Dbtree.c @@ -1234,8 +1234,8 @@ H5D__btree_idx_delete(const H5D_chk_idx_info_t *idx_info) /* Release the shared B-tree page */ if(NULL == tmp_storage.u.btree.shared) - HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "ref-counted page nil") - if(H5UC_DEC(tmp_storage.u.btree.shared) < 0) + ; /* do nothing */ + else if(H5UC_DEC(tmp_storage.u.btree.shared) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to decrement ref-counted page") } /* end if */ @@ -1454,10 +1454,12 @@ H5D__btree_idx_dest(const H5D_chk_idx_info_t *idx_info) /* Free the raw B-tree node buffer */ if(NULL == idx_info->storage->u.btree.shared) - HGOTO_ERROR(H5E_IO, H5E_CANTFREE, FAIL, "ref-counted page nil") + HGOTO_DONE(SUCCEED); if(H5UC_DEC(idx_info->storage->u.btree.shared) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTFREE, FAIL, "unable to decrement ref-counted page") + idx_info->storage->u.btree.shared = NULL; + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__btree_idx_dest() */ @@ -1517,9 +1519,8 @@ done: /* Free the raw B-tree node buffer */ if(NULL == storage.u.btree.shared) HDONE_ERROR(H5E_IO, H5E_CANTFREE, FAIL, "ref-counted shared info nil") - else - if(H5UC_DEC(storage.u.btree.shared) < 0) - HDONE_ERROR(H5E_IO, H5E_CANTFREE, FAIL, "unable to decrement ref-counted shared info") + else if(H5UC_DEC(storage.u.btree.shared) < 0) + HDONE_ERROR(H5E_IO, H5E_CANTFREE, FAIL, "unable to decrement ref-counted shared info") } /* end if */ FUNC_LEAVE_NOAPI(ret_value) |