roc230 / spymemcached

Automatically exported from code.google.com/p/spymemcached
0 stars 0 forks source link

Failed to decompress data when I prepended one item to value that it' capacity around 16KB #281

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Data capacity around 16KB, after I prepend item to it and call function get, to 
have a error

2013-07-19 11:26:15.037 WARN 
net.spy.memcached.transcoders.SerializingTranscoder:  Failed to decompress data
java.io.IOException: Not in GZIP format
    at java.util.zip.GZIPInputStream.readHeader(GZIPInputStream.java:141)
    at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:56)
    at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:65)
    at net.spy.memcached.transcoders.BaseSerializingTranscoder.decompress(BaseSerializingTranscoder.java:181)
    at net.spy.memcached.transcoders.SerializingTranscoder.decode(SerializingTranscoder.java:84)
    at net.spy.memcached.transcoders.TranscodeService$1.call(TranscodeService.java:63)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at net.spy.memcached.transcoders.TranscodeService$Task.run(TranscodeService.java:110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)

I had try value with capacity 8KB, good everything.
Help me! Thanks

Original issue reported on code.google.com by vandinhc...@gmail.com on 19 Jul 2013 at 4:49

GoogleCodeExporter commented 9 years ago
Generally speaking, you wouldn't use prepend with compression.  I know it's a 
little complicated to turn off compression or turn the threshold up, but the 
basic idea would be to replace/extend the existing transcoder.

I have a small example of how to do this with the CouchbaseClient, which builds 
on MemcachedClient.  Have a look here and see if this will help you:
https://gist.github.com/ingenthr/5952891

The reason it works with smaller things is probably because you're below the 
compression threshold.  prepend/append are just not compatible with compression.

If you want/need compression, you may want to look into appending/prepending 
with CAS.

Original comment by ingen...@gmail.com on 19 Jul 2013 at 5:43