Skip to content

osd: add processed_subop_count for cls_cxx_subop_version() - #18610

Merged
yuriw merged 3 commits into
ceph:masterfrom
cbodley:wip-osd-subop-num
Nov 1, 2017
Merged

yuriw merged 3 commits into
ceph:masterfrom
cbodley:wip-osd-subop-num

Conversation

@cbodley

@cbodley cbodley commented Oct 28, 2017 •

Copy link
Copy Markdown
Contributor

cls_log_add() relies on cls_cxx_subop_version() to generate unique keys
for log entries with the same timestamp. because cls calls back into
do_osd_ops(), resetting current_osd_subop_num means that cls_log_add()
will keep seeing the same subop version and generating the same keys.
this causes the following failure in ceph_test_cls_log:

[ RUN      ] cls_rgw.test_log_add_same_time
/home/cbodley/ceph/src/test/cls_log/test_cls_log.cc:144: Failure
      Expected: 10
To be equal to: (int)entries.size()
      Which is: 1
[  FAILED  ] cls_rgw.test_log_add_same_time (1180 ms)

Fixes: http://tracker.ceph.com/issues/21964

@dillaman

Copy link
Copy Markdown

@cbodley This change will most likely break async read handling since current_osd_subop_num was used to determine the index of the sub-op.

@dillaman

Copy link
Copy Markdown

... if you want to revert the logic of current_osd_subop_num to be a monotonically increasing number, perhaps it can be re-added with a more meaningful name (like processed_osd_subop_count?)

@cbodley

cbodley commented Oct 29, 2017

Copy link
Copy Markdown
Contributor Author

@dillaman thanks for pointing out the interaction with async reads

what do you think about using the OSDOp pointer as an index to op_finishers instead of current_osd_subop_num? then cls_cxx_subop_version() would be the only user again

i worried at first that the OSDOp pointer wasn't necessary stable between calls if, for example, extra ops were added that required the vector<OSDOp> to grow - but it looks like the finishers themselves already depend on that working by storing a OSDOp&. do you buy that?

@dillaman

Copy link
Copy Markdown

@cbodley Probably a better question for a core developer since I don't know if the pointers are stable. If so, it lgtm. You probably also want to generate teuthology tests to ensure that current_osd_subop_num behaves as expected since it took months to catch the breakage.

@cbodley
cbodley requested review from jdurgin and tchaikov October 30, 2017 15:30
@liewegas

Copy link
Copy Markdown
Member

Yeah I would prefer to introduce another int counter that is the subop_index, and rename the other field to be unrelated to the index. I worry about teh vector item pointer in the map

@cbodley

cbodley commented Oct 30, 2017

Copy link
Copy Markdown
Contributor Author

@liewegas okay, will do

cls_log_add() relies on cls_cxx_subop_version() to generate unique keys
for log entries with the same timestamp. because cls calls back into
do_osd_ops(), resetting current_osd_subop_num means that cls_log_add()
will keep seeing the same subop version and generating the same keys.
this causes the following failure in ceph_test_cls_log:

[ RUN      ] cls_rgw.test_log_add_same_time
/home/cbodley/ceph/src/test/cls_log/test_cls_log.cc:144: Failure
      Expected: 10
To be equal to: (int)entries.size()
      Which is: 1
[  FAILED  ] cls_rgw.test_log_add_same_time (1180 ms)

Fixes: http://tracker.ceph.com/issues/21964

Signed-off-by: Casey Bodley <[email protected]>
@cbodley

cbodley commented Oct 30, 2017

Copy link
Copy Markdown
Contributor Author

updated with a separate processed_subop_count for cls_cxx_subop_version(), and ceph_test_cls_log is still passing

this allows for some further cleanup to make current_osd_subop_num a local variable in do_osd_ops(), but i'm happy to leave that for a separate pr

@dillaman

dillaman commented Oct 30, 2017 •

Copy link
Copy Markdown

@cbodley Thanks -- can you also add a script for ceph_test_cls_log to "qa/workunits/cls" so that the test actually gets executed by teuthology in the future?

@dillaman dillaman left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@cbodley

cbodley commented Oct 30, 2017

Copy link
Copy Markdown
Contributor Author

updated, thanks @dillaman

@yuriw

yuriw commented Oct 30, 2017

Copy link
Copy Markdown
Contributor

@cbodley cbodley changed the title osd: don't reset subop_num in do_osd_ops osd: add processed_subop_count for cls_cxx_subop_version() Oct 30, 2017
@cbodley

cbodley commented Oct 31, 2017

Copy link
Copy Markdown
Contributor Author

teuthology run failed with:

qa/workunits/cls/test_cls_log.sh: 3: /home/ubuntu/cephtest/clone.client.0/qa/workunits/cls/test_cls_log.sh: ceph_test_cls_log: not found

it looks like i need to add some packaging stuff

@yuriw

yuriw commented Oct 31, 2017

Copy link
Copy Markdown
Contributor

@cbodley

cbodley commented Nov 1, 2017

Copy link
Copy Markdown
Contributor Author

thanks @yuriw, the rerun was all green and i see the test running successfully here:

2017-10-31T20:03:19.308 INFO:tasks.workunit:Running workunit cls/test_cls_log.sh...
2017-10-31T20:03:19.309 INFO:teuthology.orchestra.run.smithi059:Running (workunit test cls/test_cls_log.sh): 'mkdir -p -- /home/ubuntu/cephtest/mnt.0/client.0/tmp && cd -- /home/ubuntu/cephtest/mnt.0/client.0/tmp && CEPH_CLI_TEST_DUP_COMMAND=1 CEPH_REF=wip-yuri-testing-2017-10-31-1636 TESTDIR="/home/ubuntu/cephtest" CEPH_ARGS="--cluster ceph" CEPH_ID="0" PATH=$PATH:/usr/sbin CEPH_BASE=/home/ubuntu/cephtest/clone.client.0 CEPH_ROOT=/home/ubuntu/cephtest/clone.client.0 adjust-ulimits ceph-coverage /home/ubuntu/cephtest/archive/coverage timeout 3h /home/ubuntu/cephtest/clone.client.0/qa/workunits/cls/test_cls_log.sh'
2017-10-31T20:03:19.399 INFO:tasks.workunit.client.0.smithi059.stdout:Running main() from gmock_main.cc
2017-10-31T20:03:19.399 INFO:tasks.workunit.client.0.smithi059.stdout:[==========] Running 3 tests from 1 test case.
2017-10-31T20:03:19.399 INFO:tasks.workunit.client.0.smithi059.stdout:[----------] Global test environment set-up.
2017-10-31T20:03:19.399 INFO:tasks.workunit.client.0.smithi059.stdout:[----------] 3 tests from cls_rgw
2017-10-31T20:03:19.399 INFO:tasks.workunit.client.0.smithi059.stdout:[ RUN      ] cls_rgw.test_log_add_same_time
2017-10-31T20:03:22.305 INFO:tasks.workunit.client.0.smithi059.stdout:[       OK ] cls_rgw.test_log_add_same_time (2910 ms)
2017-10-31T20:03:22.305 INFO:tasks.workunit.client.0.smithi059.stdout:[ RUN      ] cls_rgw.test_log_add_different_time
2017-10-31T20:03:25.325 INFO:tasks.workunit.client.0.smithi059.stdout:[       OK ] cls_rgw.test_log_add_different_time (3020 ms)
2017-10-31T20:03:25.326 INFO:tasks.workunit.client.0.smithi059.stdout:[ RUN      ] cls_rgw.test_log_trim
2017-10-31T20:03:28.345 INFO:tasks.workunit.client.0.smithi059.stdout:[       OK ] cls_rgw.test_log_trim (3020 ms)
2017-10-31T20:03:28.345 INFO:tasks.workunit.client.0.smithi059.stdout:[----------] 3 tests from cls_rgw (8951 ms total)
2017-10-31T20:03:28.346 INFO:tasks.workunit.client.0.smithi059.stdout:
2017-10-31T20:03:28.346 INFO:tasks.workunit.client.0.smithi059.stdout:[----------] Global test environment tear-down
2017-10-31T20:03:28.346 INFO:tasks.workunit.client.0.smithi059.stdout:[==========] 3 tests from 1 test case ran. (8951 ms total)
2017-10-31T20:03:28.346 INFO:tasks.workunit.client.0.smithi059.stdout:[  PASSED  ] 3 tests.

@yuriw
yuriw merged commit 223f45e into ceph:master Nov 1, 2017
@cbodley
cbodley deleted the wip-osd-subop-num branch November 1, 2017 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants