Details
-
Bug
-
Resolution: Fixed
-
Critical
-
5.0.0
-
Triaged
-
Yes
Description
If a couchstore file becomes corrupted such that a document cannot be fetched from disk (returning CHECKSUM_FAIL or any other non-zero status), then instead of logging and returning a error to the user (TMPFAIL), KV-Engine incorrectly returns ENOENT - i.e. document doesn't exist.
Steps to Reproduce
1. Create a document with some known value:
cbc create -U couchbase://localhost:12000/default -u Administrator -P asdasd djr -V abcdefgh
|
2. Lookup the vBucket ID of the key (390 for this key):
cbc hash -U couchbase://localhost:12000/default -u Administrator -P asdasd djr
|
djr: [vBucket=390, Index=0] Server: localhost:12000, CouchAPI: http://localhost:9500/default
|
3. Eject that value from memory (so future accesses require background fetch) using the attached script:
cb_evict_key.py Administrator asdasd default 390 djr
|
4. Manually corrupt the appropriate couchstore file (390.couch.1), by replacing the value with garbage (this will cause CRC32 to fail):
perl -pi -e 's/abcdefgh/xxxxxxxx/g' ns_server/data/n_0/data/default/390.couch.1
|
5. Attempt to read the document:
cbc cat -U couchbase://localhost:12000/default -u Administrator -P asdasd djr
|
Expected Behaviour: TMPFAIL should be returned to the client (asking it to retry):
djr Temporary failure received from server. Try again later (0xb) and the failure should be logged in memcached.log: Failed background fetch for vb:390, seqno:9
Actual Behaviour: ENOENT is returned, and no message logged.
Attachments
For Gerrit Dashboard: MB-26390 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
84363,6 | MB-26390: CouchKVStore::getMultiCb: set non-zero status correctly | spock | kv_engine | Status: MERGED | +2 | +1 |
84715,1 | Merge remote-tracking branch 'couchbase/spock' | spock | kv_engine | Status: ABANDONED | 0 | -1 |
84719,1 | Merge remote-tracking branch 'couchbase/spock' | master | kv_engine | Status: MERGED | +2 | +1 |