Details
Description
I create a default bucket insert 11 items. Then backup from one node and restore to another node. Both are build 1954. I ran the script under the source node path /opt/couchbase/bin
[chisheng@cen-1716 bin]$ ./cbbackup http://10.5.2.22:8091 ~/backup
[####################] 100.0% (11/11 msgs)
bucket: default, msgs transferred...
: total | last | per sec
batch : 15 | 15 | 104.7
byte : 44 | 44 | 307.2
msg : 11 | 11 | 76.8
done
[chisheng@cen-1716 bin]$ ./cbrestore ~/backup/ http://10.5.2.23:8091
[####################] 100.0% (11/11 msgs)
bucket: default, msgs transferred...
: total | last | per sec
batch : 1 | 1 | 15.8
byte : 44 | 44 | 694.5
msg : 11 | 11 | 173.6
done
>>> client = MemcachedClient("10.5.2.22", 11211)
>>> for i in range(10):
... client.set("chisheng%s"%(i),0,100000+i,"hong")
>>> client.get("chisheng9")#source
(100009, 13944249166277618, 'hong')
>>> client1 = MemcachedClient("10.5.2.23", 11211)
>>> client1.get("chisheng9")#destination
(2844131584, 13944249166277618, 'hong')
[chisheng@cen-1716 bin]$ ./cbbackup http://10.5.2.22:8091 ~/backup
[####################] 100.0% (11/11 msgs)
bucket: default, msgs transferred...
: total | last | per sec
batch : 15 | 15 | 104.7
byte : 44 | 44 | 307.2
msg : 11 | 11 | 76.8
done
[chisheng@cen-1716 bin]$ ./cbrestore ~/backup/ http://10.5.2.23:8091
[####################] 100.0% (11/11 msgs)
bucket: default, msgs transferred...
: total | last | per sec
batch : 1 | 1 | 15.8
byte : 44 | 44 | 694.5
msg : 11 | 11 | 173.6
done
>>> client = MemcachedClient("10.5.2.22", 11211)
>>> for i in range(10):
... client.set("chisheng%s"%(i),0,100000+i,"hong")
>>> client.get("chisheng9")#source
(100009, 13944249166277618, 'hong')
>>> client1 = MemcachedClient("10.5.2.23", 11211)
>>> client1.get("chisheng9")#destination
(2844131584, 13944249166277618, 'hong')
Dumping out the packets being sent by cbrestore, I see its SET-WITH-META requests have flags fields that are in network-byte-order.
So, I suspect this might be in the ep-engine code with xxx-with-meta implementations and whether those command implementations are correctly converting (or not) the flags field with ntohl/htonl.
That is, I wonder if these lines are doing the right thing...
* https://github.com/couchbase/ep-engine/blob/master/src/ep_engine.cc#L3794
* https://github.com/couchbase/ep-engine/blob/master/src/ep_engine.cc#L3851
Can you take a look?
Thanks,
Steve