New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

osd: add asock command to dump the scrub queue #12728

Merged
merged 1 commit into from Jan 5, 2017

Conversation

Projects
None yet
4 participants
@Liuchang0812
Contributor

Liuchang0812 commented Jan 1, 2017

  • add a public method to dumps scrubs
  • register new command to asock_admin

any comments is appreciated.

@tchaikov @liewegas @athanatos

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

Signed-off-by: liuchang0812 liuchang0812@gmail.com

@Liuchang0812

This comment has been minimized.

Contributor

Liuchang0812 commented Jan 1, 2017

FYI, result of this command:

[
    {  
      "pgid": "1.0",
        "sched_time": "2017-01-02 01:35:23.289862",
        "deadline": "2017-01-07 23:41:25.673073"
    },
    {   
        "pgid": "2.6",
        "sched_time": "2017-01-02 04:07:40.349184",
        "deadline": "2017-01-08 03:24:07.231452"
    },
    {   
        "pgid": "1.3",
        "sched_time": "2017-01-02 06:18:40.805239",
        "deadline": "2017-01-08 00:14:06.916350"
    },
    {   
        "pgid": "2.4",
        "sched_time": "2017-01-02 07:58:41.714257",
        "deadline": "2017-01-08 07:15:31.032673"
    },
    {   
        "pgid": "2.3",
        "sched_time": "2017-01-02 09:17:15.723569",
        "deadline": "2017-01-08 05:44:35.507823"
    },
    {   
        "pgid": "1.7",
        "sched_time": "2017-01-02 10:02:50.532476",
        "deadline": "2017-01-08 07:58:34.595284"
    },
    {   
        "pgid": "1.4",
        "sched_time": "2017-01-02 10:40:38.610703",
        "deadline": "2017-01-08 08:41:33.200372"
    },
    {   
        "pgid": "2.7",
        "sched_time": "2017-01-02 11:56:48.821839",
        "deadline": "2017-01-08 04:00:31.616621"
    },
    {   
        "pgid": "1.6",
        "sched_time": "2017-01-02 14:09:30.878554",
        "deadline": "2017-01-08 03:37:02.696721"
    },
    {   
        "pgid": "2.5",
        "sched_time": "2017-01-02 14:29:59.059526",
        "deadline": "2017-01-08 03:59:52.597162"
    },
    {   
        "pgid": "0.7",
        "sched_time": "2017-01-02 18:16:37.088916",
        "deadline": "2017-01-08 08:09:10.976245"
    }
]

and, xml result:

<sched scrubs>
 <scrub>
  <pgid>1.0</pgid>
  <sched_time>2017-01-02 01:35:23.289862</sched_time>
  <deadline>2017-01-07 23:41:25.673073</deadline>
 </scrub>
 <scrub>
  <pgid>2.6</pgid>
  <sched_time>2017-01-02 04:07:40.349184</sched_time>
  <deadline>2017-01-08 03:24:07.231452</deadline>
 </scrub>
 <scrub>
  <pgid>1.3</pgid>
  <sched_time>2017-01-02 06:18:40.805239</sched_time>
  <deadline>2017-01-08 00:14:06.916350</deadline>
 </scrub>
 <scrub>
  <pgid>2.4</pgid>
  <sched_time>2017-01-02 07:58:41.714257</sched_time>
  <deadline>2017-01-08 07:15:31.032673</deadline>
 </scrub>
 <scrub>
  <pgid>2.3</pgid>
  <sched_time>2017-01-02 09:17:15.723569</sched_time>
  <deadline>2017-01-08 05:44:35.507823</deadline>
 </scrub>
 <scrub>
  <pgid>1.7</pgid>
  <sched_time>2017-01-02 10:02:50.532476</sched_time>
  <deadline>2017-01-08 07:58:34.595284</deadline>
 </scrub>
 <scrub>
  <pgid>1.4</pgid>
  <sched_time>2017-01-02 10:40:38.610703</sched_time>
  <deadline>2017-01-08 08:41:33.200372</deadline>
 </scrub>
 <scrub>
  <pgid>2.7</pgid>
  <sched_time>2017-01-02 11:56:48.821839</sched_time>
  <deadline>2017-01-08 04:00:31.616621</deadline>
 </scrub>
 <scrub>
  <pgid>1.6</pgid>
  <sched_time>2017-01-02 14:09:30.878554</sched_time>
  <deadline>2017-01-08 03:37:02.696721</deadline>
 </scrub>
 <scrub>
  <pgid>2.5</pgid>
  <sched_time>2017-01-02 14:29:59.059526</sched_time>
  <deadline>2017-01-08 03:59:52.597162</deadline>
 </scrub>
 <scrub>
  <pgid>0.7</pgid>
  <sched_time>2017-01-02 18:16:37.088916</sched_time>
  <deadline>2017-01-08 08:09:10.976245</deadline>
 </scrub>
</sched scrubs>
assert(f != nullptr);
Mutex::Locker l(sched_scrub_lock);
f->open_array_section("sched scrubs");

This comment has been minimized.

@tchaikov

tchaikov Jan 3, 2017

Contributor

an XML tag cannot contain space in it. see https://www.w3.org/TR/2008/REC-xml-20081126/#NT-NameChar.

so probably we can simply put "scrubs" as the tag name?

This comment has been minimized.

@Liuchang0812

Liuchang0812 Jan 3, 2017

Contributor

👍 ok

@@ -686,7 +686,7 @@ class OSDService {
}
void dumps_scrub(Formatter *f) {
assert(f!=nullptr);
assert(f != nullptr);

This comment has been minimized.

@tchaikov

tchaikov Jan 3, 2017

Contributor

please squash this commit into the previous one.

This comment has been minimized.

@Liuchang0812

Liuchang0812 Jan 3, 2017

Contributor

ok, i will squash commits after review

r = admin_socket->register_command("dump_scrubs",
"dump_scrubs",
asok_hook,
"print schedlued scrubs");

This comment has been minimized.

@xiexingguo

xiexingguo Jan 3, 2017

Member

s/schedlued/scheduled/

This comment has been minimized.

@Liuchang0812

Liuchang0812 Jan 3, 2017

Contributor

done. thanks for your review

f->open_object_section("scrub");
f->dump_stream("pgid") << i.pgid;
f->dump_stream("sched_time") << i.sched_time;
f->dump_stream("deadline") << i.deadline;

This comment has been minimized.

@tchaikov

tchaikov Jan 3, 2017

Contributor

maybe we can have a boolean field named "forced"? see http://tracker.ceph.com/issues/17861#note-5. i know, technically, it's redundant. but it helps user to understand this scrub. @athanatos what do you think?

This comment has been minimized.

@Liuchang0812

Liuchang0812 Jan 3, 2017

Contributor

it has been added. by the way, it seems that there isn't not a way to do a force scrub via ceph tools.

This comment has been minimized.

@tchaikov

tchaikov Jan 4, 2017

Contributor

both "ceph osd scrub ${osd_num}" and "ceph pg scrub ${pg_num}" force a scrub job.

r = admin_socket->register_command("dump_scrubs",
"dump_scrubs",
asok_hook,
"print schedlued scrubs");

This comment has been minimized.

@Liuchang0812

Liuchang0812 Jan 3, 2017

Contributor

done. thanks for your review

f->open_object_section("scrub");
f->dump_stream("pgid") << i.pgid;
f->dump_stream("sched_time") << i.sched_time;
f->dump_stream("deadline") << i.deadline;

This comment has been minimized.

@Liuchang0812

Liuchang0812 Jan 3, 2017

Contributor

it has been added. by the way, it seems that there isn't not a way to do a force scrub via ceph tools.

@athanatos

This comment has been minimized.

Contributor

athanatos commented Jan 3, 2017

This seems reasonable to me. I'm ok with it if @tchaikov is.

@tchaikov

This comment has been minimized.

Contributor

tchaikov commented Jan 4, 2017

@Liuchang0812

nit, the change happens in "osd" but not in any of the cli tools, might want to change the prefix of the title to "osd:".

@tchaikov tchaikov added the needs-qa label Jan 4, 2017

@tchaikov tchaikov self-assigned this Jan 4, 2017

@Liuchang0812

This comment has been minimized.

Contributor

Liuchang0812 commented Jan 4, 2017

@tchaikov OK, i will change title and test again.

@Liuchang0812 Liuchang0812 changed the title from osd/tool: add asock command to dump the scrub queue to osd: add asock command to dump the scrub queue Jan 4, 2017

@tchaikov

This comment has been minimized.

Contributor

tchaikov commented Jan 4, 2017

@Liuchang0812 sorry for the confusion. and please note that the title of this pull request is different from the one of your commit. i recommend change the later.

@Liuchang0812

This comment has been minimized.

Contributor

Liuchang0812 commented Jan 4, 2017

😄 @tchaikov I get it now

osd: add asock command to dump the scrub queue
* add a public method to dumps scrubs
* register new command "dump_scrubs" to asock_admin

Fixes: http://tracker.ceph.com/issues/17861
Signed-off-by: liuchang0812 <liuchang0812@gmail.com>
@Liuchang0812

This comment has been minimized.

Contributor

Liuchang0812 commented Jan 4, 2017

@tchaikov Updated, Waiting for test result.

@tchaikov tchaikov merged commit 0d5780c into ceph:master Jan 5, 2017

3 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
default Build finished.
Details

@Liuchang0812 Liuchang0812 deleted the Liuchang0812:fix-17861 branch Jan 5, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment