]> git.saurik.com Git - redis.git/commit
Dump ziplist hex value on failed assertion.
authorantirez <antirez@gmail.com>
Mon, 11 Jun 2012 21:44:34 +0000 (23:44 +0200)
committerantirez <antirez@gmail.com>
Mon, 11 Jun 2012 22:41:48 +0000 (00:41 +0200)
commitee789e157c767be9cbf90af5232bfeacc533e308
tree4307e550e9f9590a2684dfbc5cb9b6b509916950
parentc0de45924c4033a8650b627e75b7fd6396c52187
Dump ziplist hex value on failed assertion.

The ziplist -> hashtable conversion code is triggered every time an hash
value must be promoted to a full hash table because the number or size of
elements reached the threshold.

If a problem in the ziplist causes the same field to be present
multiple times, the assertion of successful addition of the element
inside the hash table will fail, crashing server with a failed
assertion, but providing little information about the problem.

This code adds a new logging function to perform the hex dump of binary
data, and makes sure that the ziplist -> hashtable conversion code uses
this new logging facility to dump the content of the ziplist when the
assertion fails.

This change was originally made in order to investigate issue #547.
src/debug.c
src/redis.h
src/t_hash.c