| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
* HDF5-ification of dedup calls
* Removes dedup callback from VFD struct
* VFD SWMR library code cleanup
* Committing clang-format changes
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
things, possibly does not? NFCI.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
using the new routine H5FDdeduplicate().
Simplify H5F_open() a bit, pushing some of the configuration checks into the
SMWR VFD. For example, check that page buffering is enabled in
H5FD_vfd_swmr_open() instead of in H5F_open(). Compare VFD SWMR configurations
in H5FD_vfd_swmr_dedup() instead of in H5F_open().
Clone the default file-access property list at a new file-access property list
ID, H5P_FILE_ACCESS_ANY_VFD. The new ID is used to indicate that if the file
that's being opened is already open under an existing virtual file, and if that
virtual file would not ordinarily be opened with the default FAPL, then it's ok
to use that virtual file.
Add a new optional method, `dedup`, to H5FD_class_t, and use it to customize a
VFD's deduplication.
Customize the SWMR VFD's deduplication. Make it honor H5P_FILE_ACCESS_ANY_VFD
Embed the VFD SWMR configuration in the H5FD_vfd_swmr_t to facilitate
comparison of configuration between new and old SWMR virtual files.
In H5F__sfile_search(), match using a pointer comparison instead of H5FD_cmp(),
because we will only ever enter H5F__sfile_search() with a deduplicated
H5FD_t *.
|
| |
|
|
|
|
|
| |
fails, re-load the shadow-file header and log the last-read and current tick
number.
|
|
|
|
| |
that's what both the callers and callees expect. NFCI.
|
| |
|
|
|
|
|
| |
close activities under the correct condition! Extract the reader-only open and
close code into helper routines.
|
|
|
|
|
|
| |
if H5FD__vfd_swmr_header_deserialize() succeeds, then the header that was
passed in was actually initialized. This squashes a used-before-initialized
warning from GCC.
|
|
|
|
| |
to close descriptor 0, later.
|
| |
|
| |
|
|
|
|
| |
instead of cast to H5FD_t *.
|
|
|
|
|
|
| |
multiple opens of the same file with VFD SWMR---i.e., twice for writing, or for
reading and for writing. In the long run, this will help me encapsulate more
of the SWMR functionality in the VFD, too.
|
|
|
|
|
|
|
|
|
|
| |
the lower virtual file's `exc_owner` field. While I'm here, remove a
gratuitous assertion.
This is part of a changeset that helps us avoid creating multiple H5F_shared_t
for one file when virtual datasets are used with VFD SWMR. The old code for
deduplicating VFD SWMR H5F_shared_t instances did not work correctly with VFD
SWMR, so we'd end up with multiple H5F_shared_t all active on the same file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
member to all virtual files. Add a routine, H5FD_has_conflict(), that returns
true if a new virtual file is identical to an existing virtual file that has an
exclusive owner. Establish an exclusive owner for a VFD SWMR virtual file's
lower virtual file.
Rename bsdqueue.h to H5queue.h and install it, since it's used by H5FDpublic.h.
This is part of a changeset that helps us avoid creating multiple H5F_shared_t
for one file when virtual datasets are used with VFD SWMR. The old code for
deduplicating VFD SWMR H5F_shared_t instances did not work correctly with VFD
SWMR, so we'd end up with multiple H5F_shared_t all active on the same file.
|
|
|
|
|
| |
ticks elapsed during API calls. Write the histogram to the swmr_stats
log outlet when the SWMR VFD closes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
statement-ify, changing
HGOTO_ERROR(..., \
)
to
HGOTO_ERROR(...,
);
Remove blank lines between if-clause and HGOTO_ERROR. Add some curly
braces to if-statements where that clarifies things.
NFCI.
|
|
|
|
| |
satisfied from the lower file or the shadow file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
that are longer than the buffer that the caller supplied: the checksum
usually will fail, but that's not actually a fatal condition, and
usually we will have another opportunity to verify the checksum.
In H5FD_vfd_swmr_read(), remove a bunch of disused code.
In H5FD_vfd_swmr_read(), do not re-read a shadow image that has a
bad checksum, because a bad checksum indicates a serious problem
(writer outran reader, OS defect, hardware failure) from which
H5FD_vfd_swmr_read() cannot recover.
Rationale: the writer write(2)s new shadow images before the new index,
and the new index before the new header. In H5FD_vfd_swmr_read(),
the reader has read(2) both the index and the header in full. POSIX
semantics indicate that in these circumstances, the last shadow image
write(2) MUST be completely visible when we read(2). That is, the index
write(2) & read(2) and the header write(2) & read(2) pair cannot
divide a preceding shadow-image write(2).
The reader may see a "torn" image at this juncture if, for example,
the writer got max_lag ticks ahead of it and reused the storage for
this shadow image. Even if the reader "recovers" by re-reading the
image until its checksum is correct, it cannot be sure that the
image thus read is the right one for the HDF5 address passed to
H5FD_vfd_swmr_read(), and it cannot be sure that the image thus read is
not stale, because it's operating with an out-of-date shadow index.
Add log outlets swmr_read, swmr_read_exception, and swmr_read_err.
Log to `swmr_read` on entry to H5FD_vfd_swmr_read(), log to
`swmr_read_exception` when checksums are skipped for exceptional
conditions (page buffer not configured, buffer shorter than shadow
image), and log to `swmr_read_err` when the checksum fails.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
tells whether the call may wait for the reader tick to catch up.
Add stub routines vfd_swmr_writer_may_increase_tick_to() and
vfd_swmr_reader_did_increase_tick_to() for tests---e.g.,
vfd_swmr_zoo_writer/_reader---to use to coordinate their tick numbers.
vfd_swmr_writer_may_increase_tick_to(new_tick, wait_for_reader) returns
true if the writer may increase its tick number to `new_tick` without
overrunning the reader.
A reader uses vfd_swmr_reader_did_increase_tick_to() to tell a writer
that its tick number has increased.
|
| |
|
|
|
|
|
| |
as the parent outlet of a new outlet for messages about the motion of the
shadow index.
|
|
|
|
|
| |
shadow file so that members like `garbage` are not filled with garbage that
fools us, later.
|
|
|
|
|
|
|
|
| |
time in H5PB_dest(). While we're in H5PB_dest(), mark deleted shadow-index
entries as "garbage" and skip the O(n) shadow index-entries copy.
Rename shadow index-entry member `moved_to_hdf5_file` to `moved_to_lower_file`
while I'm in here---NFCI.
|
|
|
|
|
| |
H5FD_vfd_swmr_write() comment header. Delete a superfluous comment. Delete
some whitespace at EOL. NFCI.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
shadow pages. Reduce casts by choosing correct format strings and compatible
variable types.
Poison writes to addr by making it const. Don't increase addr in the read(2)
loop because it's never used afterward.
Delete some more dead code.
Rename read_ptr as p and declare it much closer to its use. Change its type to
`char *` so that no casts are necessary to increase it.
|
| |
|
|
|
|
| |
strings.
|
| |
|
|
|
|
| |
with other code.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add to the H5F_shared_t (!) a new member that tells the index in
the shadow file where the index should be written.
Allocate shadow filespace for the header and the index separately so
that the index can float. Update tests to match the expected original
location of the index.
Introduce vfd_swmr_enlarge_shadow_index(), a routine that allocates space in
the shadow file for a new index that has (up to) twice as many entries as the
old index, allocates a new in-core index of the same size, and copies the old
in-core index to the new. Call vfd_swmr_enlarge_shadow_index() in
H5PB_vfd_swmr__update_index() when the in-core index has too few slots.
In the comment at the top of H5FD__vfd_swmr_load_hdr_and_idx(), describe the
protocol that it follows, now, when it reads the shadow header and index.
Delete some dead code in the function and add a bit of diagnostic code.
TBD quiet the diagnostic code.
In H5F_vfd_swmr_init(), follow the protocol: write the index, first, then
the header.
Modify property-list checks and tests to reserve no fewer than two pages at the
front of the shadow file for the header and index.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the way that the shadow header and shadow index are loaded.
In H5FD__vfd_swmr_load_hdr_and_idx(), adopt a new protocol for reading
the shadow file:
0 If the maximum number of retries have been attempted, then exit
with an error.
1 Try to read the shadow file *header*. If successful, continue to 2.
If there is a hard failure, then return an error. If there is a failure
that may be transient, then sleep and retry at 0.
2 If the tick number in the header is less than the tick last read by the VFD,
then return an error.
3 If the tick number in the header is equal to the last tick read by the
VFD, then exit without doing anything.
4 Try to read the shadow file *index*. If successful, continue to 5.
If there is a hard failure, then return an error. If there is a failure
that may be transient, then sleep and retry at 0.
5 If a different tick number was read from the index than from the index,
then continue at 0.
6 Try to *re-read* the shadow file *header*. If successful, continue to 7.
If there is a hard failure, then return an error. If there is a failure
that may be transient, then sleep and retry at 0.
7 Compare the header that was read previously with the new header. If
the new header is different than the old, then we may not have read
the index at the right shadow-file offset, or the index may have been
read in an inconsistent state, so sleep and retry at 0. Otherwise,
return success.
Simplify H5FD__vfd_swmr_header_deserialize() and
H5FD__vfd_swmr_index_deserialize(). Remove their retry loops. Make
each return TRUE on success, FALSE on an error that may be transient,
and FAIL on an irrecoverable error.
In H5FD__vfd_swmr_header_deserialize(), do not check the size of the
shadow file with fstat(2), since the read(2) will fail if the file is
too small. This saves us a system call.
Lightly consti-ify H5FD__vfd_swmr_index_deserialize() arguments.
In H5FD__vfd_swmr_load_hdr_and_idx():
Consolidate all of the retry-looping. Increase the initial
retry delay from 1ns to 1/10s. Delete the disused maximum-retry
constants.
Use #if 0 to disable some error-checking code that ought to be
unnecessary under the new protocol.
Don't memset() the header and index header, but make sure
they're fully initialized with real content, instead.
|