Bug hunting: Deadlocks, data safety, and dumb shit
authorChip Black <bytex64@bytex64.net>
Sat, 1 Jun 2013 08:02:51 +0000 (03:02 -0500)
committerChip Black <bytex64@bytex64.net>
Sat, 1 Jun 2013 08:17:33 +0000 (03:17 -0500)
- Don't preallocate index files, instead just ftruncate() them to size.
  Index locality is pretty well moot when we're never reading more than
  50 entries at a time.
- Factor out data remapping
- Added extra bounds checks for segments and records
- Wasn't actually updating blerg->current_segment when switching
  segments, causing deadlock when the second record is written in a new
  segment.
- Use posix_fallocate() instead of writing zeroes
- Update record count *after* successfully writing a record, not before
- Use fstat to determine new record data offset instead of ftell (not
  sure if this is better, but it sure looks cleaner).
- Don't bother trying to write the rest of the data when we get a short
  write.  Truncate and move on.


No differences found