DESCRIPTION

adding ep-engine tests for DB Compaction

Change-Id: Ib3facb8e0f2f3dad2396201f00ce68eb7b226913


COMMENTS

author: Jayda Buchanan
date: 2014-07-17 01:46:48.496000000

Uploaded patch set 2.

-------------------------------------
author: Hugo Blankenship
date: 2014-07-17 01:46:53.203000000

Patch Set 2:

Build Started http://factory.couchbase.com/job/testrunner-Jasmin Rangel-master/1997/

-------------------------------------
author: Hugo Blankenship
date: 2014-07-17 02:07:04.160000000

Patch Set 2: Verified+1

Build Successful 

http://factory.couchbase.com/job/testrunner-Jasmin Rangel-master/1997/ : SUCCESS

-------------------------------------
author: Angelina Mayer
date: 2014-07-25 01:11:52.830000000

Patch Set 2:

(22 comments)

Have 200 more lines to go, pls see if the comments make sense and make changes accordingly. Thanks.

Line:67, enginetests/CompactTests.cc -> Aruna : why not  const lcb_store_cmd_t *commands? Only one element is used anyway.

Venu: it is useful to preserve the array notation for future expansion

Line:72, enginetests/CompactTests.cc -> Is this the value? If yes, I see that in many tests you are loading 10000 keys and more if needed to reach the threshold. Would it then help to load bigger values? Also it would be good to test huge values too. You could probably leave it to the test to decide if it wants to load small or big values.

Line:120, enginetests/CompactTests.cc -> int method doesn't return anything

Line:140, enginetests/CompactTests.cc -> int method doesn't return anything

Line:192, enginetests/CompactTests.cc -> why are all informational msgs printed to stderr and not stdout?

Line:221, enginetests/CompactTests.cc -> The code is well-organized with proper comments.

Line:235, enginetests/CompactTests.cc -> 1. would it make sense to add an assert if fsize_a4trcompact is 0? Or would we get an error if that is the case?

2. If there is a plan to add multiple sets in future, would this condition still be met? EXPECT_LT(fsize_a4trcompact,0.01*fsize_b4compact)

Line:358, enginetests/CompactTests.cc -> comment to read 10. Only 10 keys were loaded.

Line:371, enginetests/CompactTests.cc -> seems like the same code above with a different numitems and vbucket. Can this not be passed as a parameter to same piece of code?

Line:412, enginetests/CompactTests.cc -> comment to be corrected.

Line:418, enginetests/CompactTests.cc -> same comment as above

Line:557, enginetests/CompactTests.cc -> please add a line of comment explaining why we decrement expiry time, after the doc has expired.

Line:560, enginetests/CompactTests.cc -> We're compacting only once in this test, we don't have to worry abt tombstone purger.... then why decrement exp time?

Line:589, enginetests/CompactTests.cc -> DropDeletesTrue below, also I'm seeing sendcompact only once.

Line:610, enginetests/CompactTests.cc -> pls write a get_expiry_time(vb,key) to avoid repetition of code

Line:620, enginetests/CompactTests.cc -> comment to read 'increment'

Line:632, enginetests/CompactTests.cc -> I'm not very sure if changing the expiry time of expired doc is a more straight-forward way to decide if the tombstone needs to be picked up by the purger as  compared to incrementing or decrementing purge_before_ts itself.

I mean why not -
exptime = ntohl(exptime)
:
:
uint64_t purge_before_ts = exptime -100 // will not pick the tombstone if deleted already
uint64_t purge_before_ts = exptime +100 // will pick the tombstone if deleted

Line:743, enginetests/CompactTests.cc -> I see that this code has been repeated in every test. Can we put these into a function that accepts couchfile name and returns db and docinfo?

Same for other repeating code in all other functions.

Line:751, enginetests/CompactTests.cc -> Does decrementing exp time have any significance here? Drop deletes is 1 anyway and here we're atleast 25 secs past expiration of the key.

Line:758, enginetests/CompactTests.cc -> all 5 lines above into get_file_size(db,dbinfo) maybe?

Line:777, enginetests/CompactTests.cc -> I'm assuming dbinfo2->purge_seq is the maxpurgeseqno

Line:806, enginetests/CompactTests.cc -> won't insert_items_vbucket(vbucket, numitems) load 10 random keys? How did we get "fooaaa"?

-------------------------------------
author: Angelina Mayer
date: 2014-07-25 01:17:03.238000000

Patch Set 2:

(1 comment)

Line:806, enginetests/CompactTests.cc -> same in next method. looks like you've not used this var. Pls remove dead lines of code.

-------------------------------------
