Lendfating / leveldb

Automatically exported from code.google.com/p/leveldb
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Improve error handling in background thread #174

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
There's a report[1] on the chromium issue tracker of a background thread eating 
10-20% of CPU. This is reportedly due to leveldb encountering an error during a 
compaction, sleeping for 1s, and retrying in an infinite loop. Instead of 
hardcoding 1 second, we could instead not retry at all for Corruption errors 
and do a limited exponential backoff for I/O errors.

1. https://code.google.com/p/chromium/issues/detail?id=244932

Original issue reported on code.google.com by dgrogan@chromium.org on 29 May 2013 at 7:14

GoogleCodeExporter commented 9 years ago

Original comment by dgrogan@chromium.org on 29 May 2013 at 7:14

GoogleCodeExporter commented 9 years ago
LevelDB 1.11.0 does a very limited exponential backoff. The first error 
encountered by the compaction thread causes a 1 second wait. The second 
consecutive error causes a 2 second wait, etc, up to a max of 8 seconds.

Original comment by dgrogan@chromium.org on 13 Jun 2013 at 11:29