memtier_benchmark icon indicating copy to clipboard operation
memtier_benchmark copied to clipboard

Sample file for --data-import

Open choijon5 opened this issue 7 years ago • 3 comments

I'd like to verify the output data of a Memcached server (using --data-verify) using binary protocol. The --data-verify flag requires to import a file using --data-import.
I've tried creating a file following the structure described in README.import, but I keep getting an error. Would someone be able to provide a sample file for --data-import, and what the expected output of memtier_benchmark would be when running --data-verify with the file?

choijon5 avatar Apr 11 '18 19:04 choijon5

By gdb'ing through the code, I was able to create a file that is read in properly. The file has to be structured in the exact format that Memtier expects, including spaces, so a sample file with the README would really help in my opinion. Now, I'm not really sure what to make of the results though. My very simple object file has the following: dumpflags, time, exptime, nbytes, nsuffix, it_flags, clsid, nkey, key, data 0, 0, 10, 4, 4, 0, 1, 1, a, 11 Now, when I run 1 get command, I see: Reading keys from memcached_simple.csv... 1 keys read. Performing data verification... Data verification completed: 0 keys verified successfuly. 0 keys failed.

When I run 1 set command, I see: Reading keys from memcached_simple.csv... 1 keys read. Performing data verification... error: key [a]: expected [11], got [Not found] Data verification completed: 0 keys verified successfuly. 1 keys failed.

Does this mean that when I run 1 set, it writes to memcached then reads it back to verify the value? Not sure why it's getting "Not found"...

choijon5 avatar Apr 11 '18 21:04 choijon5

I'm answering myself again, but I figured it out. First you need to run sets only without --verify-only, which actually writes to the cache, then you run sets only again with --verify-only, which verifies that the written data matches what's in the object file. I'm curious why gets don't work with --verify-only though. It's a bit counter-intuitive that only sets can be used.

choijon5 avatar Apr 11 '18 21:04 choijon5

I generated the file in the same format by referring to yours. Below is an example of the first few entries.

dumpflags, time, exptime, nbytes, nsuffix, it_flags, clsid, nkey, key, data 0, 0, 0, 200, 200, 0, 1, 200, sqjbmtzgladigkgckqxhqvkvnvcdrctjfqvsfnkwcocgagwvfbsbpadxxirdnkfexzifhmqxriaqvwiwxegholwgheabfqdhvxyqquaoxqrcebhjlvvsurgofgaapmqgyvtngtfkhiowfezfsjsyspzdffaojbwwqombzlvwhqqxdschnjgcjtgfmdxmvpmujreflbvc, ddcihrvrhfykwaprhhoxrgqcgcekmxkfkptrkhsvptkgnxqrazainyabxdkznmsgrpsgyeuxzkdopkpioevdmifibezsdhvglfjfojctdrxwlosunongwfpwrsuklfxrkneovbbhkspbmpsqloczpjzoiumspoxhtrqttsyhbrqgbhmibpdzpkboxrpshnylickresgq 0, 0, 0, 200, 200, 0, 1, 200, voaidlhyacrsxwurfwbdharbcuiotsaabyjhohqrperazwfialssbekpdhjujsfosvqvdtkvdocghakxqfxpbjrlpacixygnforgvpkojbylonzynvnezmhenlkmmerisipveqfrefpmgmnumtwtckdvlklegtcmygibekvktjmikqvobepdrdahcvildjprbgtlowam, fujwzhpvjutlhxycaivguimukkkhtvvkwktbtuhthudapksgynusznwnbaarjjqtdroukejmcgfdjzcerfjbbaoclgattmokezeeooptggpqdwagcltwqhbdnhsyxstxfdsgoemsbnbjyjgtmnklklhvjspsxbcnaffsofxrlxzgjwppdjyaioonzzxbhrsydivfmlkf

I want to insert these as key value pairs using memcache_text. I am using the following command: memtier_benchmark -p 11211 -P memcache_text -t 4 -n 100 –ratio 1000:0 -c 25 -x 5 --data-import=key.csv

But I am getting this error- key.csv:2: error parsing item values.

Do you know anything about this?

Upasana2101 avatar Mar 26 '19 17:03 Upasana2101