storj/storagenode/orders/ordersfile
Moby von Briesen db480e6e1b storagenode/orders: Improve performance of handling corrupt orders.
This change fixes two things which can make reading from a corrupted
orders file inefficient.
* When a corrupted order is detected, but the underlying error is an
UnexpectedEOF (as opposed to a pb.Unmarshal error, for instance), there
is no point in attempting to read from the file another time to find an
additional uncorrupted order - we will continue to get UnexpectedEOF
errors until we seek to the very end of the file and get a normal EOF.
Instead, when UnexpectedEOF occurs, log and send metrics as with other
types of corruption, but do not attempt to read again.
* When a corrupted order is detected, instead of seeking forward only
one byte for the next attempt, seek forward by the size of entryHeader.
This cuts down on the number of iterations needed to find an uncorrupted
order after detecting a corrupted one.

Change-Id: Ie1a613127e29d29318584ec7f60e8f7554f73487
2020-11-16 14:08:36 +00:00
..
common.go storagenode/orders: Add V1 orders file 2020-10-14 15:04:33 +00:00
v0.go storagenode/orders/ordersfile: Handle remaining pb.Unmarshal errors 2020-10-26 20:27:05 +00:00
v1.go storagenode/orders: Improve performance of handling corrupt orders. 2020-11-16 14:08:36 +00:00