From 4351ad6c4e8c5ac527e2ccd5f91b3b2b9ad60002 Mon Sep 17 00:00:00 2001 From: David Young Date: Mon, 8 Jun 2020 17:47:17 -0500 Subject: Only remove shadow-index entries in H5PB__evict_entry() if we're a VFD SWMR writer, so that the reader does not lose track of the real shadow-index content. --- src/H5PB.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/H5PB.c b/src/H5PB.c index 8ece8a3..b0aae86 100644 --- a/src/H5PB.c +++ b/src/H5PB.c @@ -1254,7 +1254,7 @@ H5PB_remove_entry(H5F_shared_t *shared, haddr_t addr) HGOTO_ERROR(H5E_PAGEBUF, H5E_SYSTEM, FAIL, "forced eviction failed") - assert(vfd_swmr_pageno_to_mdf_idx_entry(shared->mdf_idx, shared->mdf_idx_entries_used, page, false) == NULL); + assert(!shared->vfd_swmr_writer || vfd_swmr_pageno_to_mdf_idx_entry(shared->mdf_idx, shared->mdf_idx_entries_used, page, false) == NULL); } done: @@ -2434,7 +2434,8 @@ H5PB__evict_entry(H5F_shared_t *shared, H5PB_entry_t *entry_ptr, bool force, * the image will be bigger. So the shadow file will never see the * entire image written, just the first page of the image. */ - if (shadow_idx_entry_remove(shared, entry_ptr->page, only_mark) == -1) { + if (shared->vfd_swmr_writer && + shadow_idx_entry_remove(shared, entry_ptr->page, only_mark) == -1) { HGOTO_ERROR(H5E_PAGEBUF, H5E_SYSTEM, FAIL, "failed to remove shadow index entry") } -- cgit v0.12