Please sign in to comment.
MB-6638: use fork of file_sorter that doesn't use compression
We've found that file driver may close underlying file (either OS file or gzFile) well before async read on it is done. With real OS file that's mostly harmless, and kernel will synchronize racing close and read (or any other syscall for same fd) and read will either succeed just before close or it'll get EBADF (well, or read some other newly opened innocent file). But gzFile doesn't have any synchronization. So attempt to read it concurrently or shortly after close may cause lots of problems. Given we don't really use compressed feature of file sorter I'm just cutting out one small piece of it that's using this efile feature. Entire file_sorter.erl is forked inside couchdb source tree and single change is made. It removes compressed option in file:open call in read_fun. NOTE: file_sorter.erl is building improper lists which dialyzer authors choose to dislike. I had to disable that somewhat questionable warning in order to keep code dialyzer-clean. "Fixing" file_sorter.erl is IMHO not an option as we want to keep it as intact as possible. Change-Id: I8ded572c18e236661d5b7df2a780c8f293fc689d Reviewed-on: http://review.couchbase.org/23555 Reviewed-by: Aliaksey Artamonau <firstname.lastname@example.org> Reviewed-by: Filipe David Borba Manana <email@example.com> Tested-by: Aliaksey Kandratsenka <firstname.lastname@example.org>
- Loading branch information...
Showing with 1,627 additions and 2 deletions.
Oops, something went wrong.