| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
subsequent hlog_fast() calls.
While I'm here, add a typedef, hlog_outlet_t, for struct hlog_outlet, and use
it.
|
| |
|
|
|
|
| |
NFCI.
|
| |
|
| |
|
|
|
|
|
|
|
| |
implementation, rename hlog_log() to hlog(), hlog_vlog() to vhlog(), et cetera.
Rename hlog_lazy() to hlog_fast().
Define some log sinks and use them in the page buffer and in VFD SWMR.
|
| |
|
|
|
|
| |
sources but put the full notices & license terms in COPYING.
|
|
|
|
| |
longer than it needs to be. NFCI.
|
|
|
|
|
| |
that works in byte offsets rather than page offsets. Use
shadow_range_defer_free() to defer shadow-index frees.
|
|
|
|
|
| |
with some casts and an unsigned constant. This quiets GCC warnings, especially
-Wconversion, IIRC.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
never read.
|
|
|
|
| |
strings.
|
| |
|
|
|
|
| |
with other code.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
for them did not help me keep track of what they were for.
For brevity, I will call a deferred free record a "defree" in the code.
The deferred_free_queue_t becomes a lower_defree_queue_t, and each record on
the queue becomes a lower_defree_t. A lower_defree_t tracks one deferred free
on the lower VFD---that is, the one under the SWMR VFD.
The old_image_queue_t becomes a shadow_defree_queue_t, and a record therein is
a shadow_defree_t. A shadow_defree_t tracks one deferred free on the shadow
file.
|
| |
|
|
|
|
| |
Delete a comment on a closing curly brace.
|
|
|
|
| |
assertion.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
an H5F_shared_t because the new routine that will relocate the index (which
will be in a future commit) has to pass an H5F_t to the filespace allocator.
|
| |
|
| |
|
| |
|
|
|
|
| |
assignment to copy `struct timespec`. NFCI.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
int32_t.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
simplify H5FD__vfd_swmr_index_deserialize(): reuse
h5_retry_init()/h5_retry_next() for retry loops.
Don't wait for the fstat(2) to read the correct size, because the
read(2) will return short if the file isn't long enough. (This change
should save at least one system call, always.)
Leave a bunch of comments about the changes that I will have to make so
that the shadow index will float.
NFCI: do not cast H5MM_malloc() return values, this is not C++.
|
|
|
|
|
|
|
| |
it's not necessary to iterate over pass numbers any more,
so just use two loops.
While I'm in here, change a comment or formatting here and there.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
compares both new and old shadow indices and calls H5PB_remove_entry()
on each entry that was in the old index but is not in the new.
Ever since H5PB_remove_entry() started removing shadow index
entries, it has been possible for H5F_vfd_swmr_reader_end_of_tick()
to walk past the end of the new shadow index or even to skip entries
in the new index. Sometimes an assertion failed when that happened.
I have restructured the code in H5F_vfd_swmr_reader_end_of_tick()
so that it compares the old and new indices, gathering a list of
removed pages, in one step. In the next step, it processes the
list of removed pages, calling H5PB_remove_entry() on each page.
In the step after that, it notifies the metadata cache of each
removed page. This fixes the bug I described, above.
|
|
|
|
|
| |
assert() our expectation that either a NULL index was passed, or a
pointer to the index length was passed in, too.
|
|
|
|
|
|
|
| |
`if ((p = allocate(...)) == NULL) { }` into two statements, `p =
allocate(...); if (p == NULL) { }`, put a semicolon at the end of an
HGOTO_ERROR(), remove comments /* end if */, /* end for */ after closing
curly braces.
|
|
|
|
|
|
| |
pointer to the metadata index instead of copying the index itself. Use
struct assignment instead of copying individual struct members. Lower a
staircase.
|
|
|
|
|
|
| |
duplicate entries for the same HDF5 page offset. There's an O(n) cost
to that, but it should be no more than the O(n log n) cost of the
quicksort.
|
|
|
|
| |
malloc(3) and a for-loop that zeroes the index.
|
|
|
|
|
| |
because the H5PB__evict_entry() call should have already done that.
Instead, just assert() that the index entry is not present.
|
|
|
|
|
|
| |
names. While I am here, do not copy the last element of the index over
the element that's being deleted, because in the very next step I'm
shifting all elements over by one.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
`uint64_t` to `size_t` because it describes the size of an in-core
structure as well as an on-disk one, and `size_t` is wide enough
to store the size of any in-core structure, while `uint64_t` may
be much too wide. Check that `index_length` is no more than SIZE_MAX
after we read it.
|
| |
|
| |
|
| |
|
|
|
|
| |
statement. Delete an unnecessary backslash line continuation. NFCI.
|
|
|
|
| |
compute its base address and free it.
|