summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2019-09-27 18:34:17 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2019-09-27 18:34:17 (GMT)
commitde33d5cb3c35524d20ca360794ae3e3c4febb5fe (patch)
tree18e471277b577a9a59f8591c7dd654c85c192d15 /test
parentf0596cea6537326f929fd9fc2c226485de1f97d9 (diff)
downloadhdf5-de33d5cb3c35524d20ca360794ae3e3c4febb5fe.zip
hdf5-de33d5cb3c35524d20ca360794ae3e3c4febb5fe.tar.gz
hdf5-de33d5cb3c35524d20ca360794ae3e3c4febb5fe.tar.bz2
Rename the metadata test again to reflect how it's checking the page
buffer's treatment of multipage metadata entries (MPMDEs). Mention why an H5PB_flush() is not necessary for MPMDEs to reach visibility at the VFD layer.
Diffstat (limited to 'test')
-rw-r--r--test/page_buffer.c41
1 files changed, 28 insertions, 13 deletions
diff --git a/test/page_buffer.c b/test/page_buffer.c
index bf71ac7..235da00 100644
--- a/test/page_buffer.c
+++ b/test/page_buffer.c
@@ -597,12 +597,14 @@ error:
/*
- * Function: test_metadata_delay_basic()
+ * Function: test_mpmde_delay_basic()
*
- * Purpose: Perform a basic check that metadata is not written
- * immediately to the HDF5 file in VFD SWMR mode, but
- * it is buffered in the shadow file until max_lag ticks
- * have elapsed.
+ * Purpose: Perform a basic check that a multi-page metadata entry
+ * (MPMDE) is not written immediately to the HDF5 file in
+ * VFD SWMR mode, but it is buffered in the shadow file
+ * until max_lag + 1 ticks have elapsed. Furthermore,
+ * check that it appears *immediately* after max_lag + 1
+ * ticks, since the LRU list does not hold onto MPMDEs.
*
* Return: 0 if test is sucessful
* 1 if test fails
@@ -611,7 +613,7 @@ error:
* 16 Sep 2019
*/
static unsigned
-test_metadata_delay_basic(hid_t orig_fapl, const char *env_h5_drvr)
+test_mpmde_delay_basic(hid_t orig_fapl, const char *env_h5_drvr)
{
char filename[FILENAME_LEN]; /* Filename to use */
hid_t file_id = -1; /* File ID */
@@ -625,7 +627,7 @@ test_metadata_delay_basic(hid_t orig_fapl, const char *env_h5_drvr)
H5F_vfd_swmr_config_t config; /* Configuration for VFD SWMR */
hsize_t pgsz = sizeof(int) * 200;
- TESTING("Metadata Handling");
+ TESTING("Multipage Metadata Delay Handling");
h5_fixname(namebase, orig_fapl, filename, sizeof(filename));
@@ -682,17 +684,30 @@ test_metadata_delay_basic(hid_t orig_fapl, const char *env_h5_drvr)
odata) < 0)
FAIL_STACK_ERROR;
+ /* H5Fvfd_swmr_end_tick() processes delayed writes before it increases
+ * the tick number, so it takes `max_lag + 1` times through this loop
+ * for a multi-page metadata write to make it to the HDF5 file.
+ */
for (i = 0; i < config.max_lag + 1; i++) {
-
/* All elements read using the VFD should be 0. */
- if (!vfd_read_each_equals(f, H5FD_MEM_BTREE, addr, num_elements, data, 0))
+ if (!vfd_read_each_equals(f, H5FD_MEM_BTREE, addr, num_elements,
+ data, 0))
TEST_ERROR;
H5Fvfd_swmr_end_tick(file_id);
+ }
+
+ /* It is not necessary to flush the page buffer because delayed
+ * multi-page metadata buffers are flushed *immediately*
+ * when their delay elapses.
+ *
+ * If we were waiting for a single-page metadata buffer to
+ * appear at the VFD layer, then it may reside in the LRU buffer
+ * for a while.
+ */
#if 0
- if (H5PB_flush(f) < 0)
- FAIL_STACK_ERROR;
+ if (H5PB_flush(f) < 0)
+ FAIL_STACK_ERROR;
#endif
- }
/* All elements read using the VFD should be -1. */
if (!vfd_read_each_equals(f, H5FD_MEM_BTREE, addr, num_elements, data, -1))
@@ -2750,7 +2765,7 @@ main(void)
nerrors += test_args(fapl, env_h5_drvr);
nerrors += test_raw_data_handling(fapl, env_h5_drvr, false);
nerrors += test_raw_data_handling(fapl, env_h5_drvr, true);
- nerrors += test_metadata_delay_basic(fapl, env_h5_drvr);
+ nerrors += test_mpmde_delay_basic(fapl, env_h5_drvr);
nerrors += test_lru_processing(fapl, env_h5_drvr);
nerrors += test_min_threshold(fapl, env_h5_drvr);
nerrors += test_stats_collection(fapl, env_h5_drvr);