Skip to content

Used Cached File Health and Add Health Field to UnfinishedUploadChunk

Matthew Sevey requested to merge 3554-remove-offline-goodforrenew-maps into master

The cached health of the siafile is updated and saved during bubble. Since the repair loop operates off of the metadata information updated by bubble this cached health is accurate enough to use in order to determine if a file has any chunks that need repair. This makes the operation of checking a file's health to decide whether or not to build chunks from it a constant time operation.

When we build the unfinishedUploadChunk we are building the piece information needed to calculate the health of the chunk. This means we can remove the call to calculate the chunk's health and just add a health field to the chunk and set it based on the piece information already gathered.

buildUnfinishedChunks was consistently a top hitter in the cpu profiles but after this change it does not appear in the top 10.

Works on #3554 (closed)

Merge request reports