couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peta Bogdan <>
Subject badmatch on big binary
Date Tue, 17 Jan 2012 09:35:05 GMT

I have a small database around 120 MB with approximately 16,000 documents.

However, it happens (also from futon) that I get this error:

[Tue, 17 Jan 2012 07:22:01 GMT] [error] [<0.185.0>] {error_report,<0.30.0>,

If this error occurs to frequently causes couch_server to reach its max
restart frequency causing the entire supervision tree to shutdown and hence
the database server instance disappears.

The function couch_file:read_raw_iolist_int/3 calls file:pread which
returns {ok, Binary}. This Binary has almost 9 megabytes in size, which is
very strange.
I think this does mean that the function file:pread/3 is instructed to read
from wrong position.

The only reason I can think of is that the value of 'TotalBytes' from line
(1) doesn't match the value of 'TotalBytes' from line (2)

(1) TotalBytes = calculate_total_read_len(BlockOffset, Len),
(2) {ok, <<RawBin:TotalBytes/binary>>} = file:pread(Fd, Pos, TotalBytes),

The possible answer would be that in certain conditions the function
calculate_total_read_len/2 doesn't return the expected value.

Server: CouchDB/1.1.1 (Erlang OTP/R14B04)
OS: OpenBSD 5.0 GENERIC.MP#63 amd64

Now, the trouble is how to circumvent this situation.

Thank you in advance,


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message