• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • Projects
  • Repositories
    • View all public repositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
David Young
  1. David Young

vchoi_fork

Vailin Choi
my_hdf5_fork
Public
Actions
  • Clone
  • Download

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Graphs
  • Branches
  • Network
  • Latest Activities

Commits

David Young
18a90ecd94b
David Young committed cb8c5e6990a24 Jan 2020
Prepare the VFD SWMR reader for a "floating" shadow index by overhauling
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.

Changed files

  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v4.4.1
  • Documentation
  • Contact Support
  • Request a feature
  • About
  • Contact Atlassian
Atlassian