[MB-6176] cbbackup/cbrestore doesn't backup and restore item flag correctly Created: 09/Aug/12  Updated: 10/Sep/12  Resolved: 10/Aug/12

Status: Closed
Project: Couchbase Server
Component/s: tools
Affects Version/s: 2.0
Fix Version/s: 2.0
Security Level: Public

Type: Bug Priority: Major
Reporter: Chisheng Hong (Inactive) Assignee: Steve Yen
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
I create one item on one node and restore it to another node. I use memcached client to check the item flag before and after backup/restore. The item flag mismatches.

Chishengs-MacBook-Pro:membase-cli chisheng$ ./cbbackup http://Administrator:password@10.5.2.22:8091 ~/backup/backup2
  [####################] 100.0% (1/1 msgs)
bucket: default, msgs transferred...
       : total | last | per sec
 batch : 4 | 4 | 81.5
 byte : 5 | 5 | 101.9
 msg : 1 | 1 | 20.4
done

Chishengs-MacBook-Pro:membase-cli chisheng$ ./cbrestore ~/backup/backup2 http://Administrator:password@10.5.2.23:8091 -x try_xwm=0
  [####################] 100.0% (1/1 msgs)
bucket: default, msgs transferred...
       : total | last | per sec
 batch : 1 | 1 | 15.7
 byte : 5 | 5 | 78.5
 msg : 1 | 1 | 15.7
done

The python output:
>>> c= MemcachedClient('10.5.2.22',11211)
>>> c.set("chisheng",0,0xfffffff0,"lindy")
(4288761800, 5038202653468618, '')
>>> c.get("chisheng")
(4294967280, 5038202653468618, 'lindy')
>>> a=MemcachedClient('10.5.2.23', 11211)
>>> a.get("chisheng")
(4043309055, 5039149778647819, 'lindy')

The first field is the item flag for the return value for get()


 Comments   
Comment by Chisheng Hong (Inactive) [ 09/Aug/12 ]
Hi Steve,
I notice the cas value also mismatch before and after the backup/restore. Should I file another bug for that. Or you already work on that?
Comment by Steve Yen [ 10/Aug/12 ]
Also, this was for 2.0 servers.

(And, the CAS thing would be a separate bug. In general, don't tack separate issues into the same bug.)
Comment by Steve Yen [ 10/Aug/12 ]
This is because the TAP protocol isn't using network-byte-order by default for item flags. The cbbackup client needs to use the TAP_CONNECT_TAP_FIX_FLAG_BYTEORDER flag when doing its initial TAP connect.
Comment by Chisheng Hong (Inactive) [ 10/Aug/12 ]
Shall I add this flag in command line?
Comment by Steve Yen [ 10/Aug/12 ]
No, the TAP_CONNECT_TAP_FIX_FLAG_BYTEORDER is a code-level change, and there won't be any expected command-line parameter changes as part of the fix.
Comment by Steve Yen [ 10/Aug/12 ]
ep-engine change...

  http://review.couchbase.org/19496
Comment by Steve Yen [ 10/Aug/12 ]
on gerrit...

  http://review.couchbase.org/19499
  http://review.couchbase.org/19500
Comment by Thuan Nguyen [ 11/Aug/12 ]
Integrated in github-ep-engine-2-0 #395 (See [http://qa.hq.northscale.net/job/github-ep-engine-2-0/395/])
    MB-6176: expose TAP_FLAG_TAP_FIX_FLAG_BYTEORDER to python (Revision 3ecd7e346c5c1f54df6b9e1706f6d58198881a81)

     Result = SUCCESS
Steve Yen :
Files :
* management/memcacheConstants.py
Generated at Wed Apr 23 03:16:51 CDT 2014 using JIRA 5.2.4#845-sha1:c9f4cc41abe72fb236945343a1f485c2c844dac9.