Skip to content
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

mimic: tools/rados: list objects in a pg #30893

Merged
merged 4 commits into from Oct 21, 2019
Merged

Conversation

@smithfarm smithfarm added this to the mimic milestone Oct 14, 2019
@smithfarm smithfarm added the tools label Oct 14, 2019
@smithfarm smithfarm changed the title mimic: tools/rados: call pool_lookup() after rados is connected. mimic: tools/rados: call pool_lookup() after rados is connected and add --pgid in help Oct 14, 2019
@smithfarm smithfarm requested review from neha-ojha and vumrao Oct 14, 2019
Copy link
Contributor

vumrao left a comment

@smithfarm we need to pull to more commits as done in luminous backport #30608. As mimic does not have support for pgid in rados ls.

@smithfarm

This comment has been minimized.

Copy link
Contributor Author

smithfarm commented Oct 15, 2019

/home/jenkins-build/build/workspace/ceph-pull-requests/src/tools/rados/rados.cc: In function 'int rados_tool_common(const std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >&, std::vector<const char*>&)':
/home/jenkins-build/build/workspace/ceph-pull-requests/src/tools/rados/rados.cc:2135:30: error: redeclaration of 'boost::optional<pg_t> pgid'
   boost::optional<pg_t> pgid(i != opts.end(), pg_t());
                              ^
/home/jenkins-build/build/workspace/ceph-pull-requests/src/tools/rados/rados.cc:2100:25: note: 'boost::optional<pg_t> pgid' previously declared here
   boost::optional<pg_t> pgid(i != opts.end(), std::move(pg_t()));
                         ^~~~
/home/jenkins-build/build/workspace/ceph-pull-requests/src/tools/rados/rados.cc:3512:64: error: cannot convert 'std::_MakeUniq<ceph::JSONFormatter>::__single_object' {aka 'std::unique_ptr<ceph::JSONFormatter, std::default_delete<ceph::JSONFormatter> >'} to 'ceph::Formatter*' in assignment
       formatter = std::make_unique<JSONFormatter>(pretty_format);
                                                                ^
/home/jenkins-build/build/workspace/ceph-pull-requests/src/tools/rados/rados.cc:3514:55: error: request for member 'get' in 'formatter', which is of pointer type 'ceph::Formatter*' (maybe you meant to use '->' ?)
     ret = do_lock_cmd(nargs, opts, &io_ctx, formatter.get());
                                                       ^~~
/home/jenkins-build/build/workspace/ceph-pull-requests/src/tools/rados/rados.cc: At global scope:
/home/jenkins-build/build/workspace/ceph-pull-requests/src/tools/rados/rados.cc:1165:12: warning: 'int do_lock_cmd(std::vector<const char*>&, const std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >&, librados::IoCtx*, ceph::Formatter*)' defined but not used [-Wunused-function]
 static int do_lock_cmd(std::vector<const char*> &nargs,
            ^~~~~~~~~~~
src/tools/CMakeFiles/rados.dir/build.make:62: recipe for target 'src/tools/CMakeFiles/rados.dir/rados/rados.cc.o' failed
make[3]: *** [src/tools/CMakeFiles/rados.dir/rados/rados.cc.o] Error 1
dragonylffly and others added 2 commits May 3, 2018
When the cluster is not healthy, normally only a very few pgs encounter
problems, and the operator wants to know which objects may potentially
get lost.

Signed-off-by: Li Wang <laurence.liwang@gmail.com>
(cherry picked from commit 825c7b9)

Conflicts:
	src/tools/rados/rados.cc
- 6e4db7b is not being backported to mimic
This commit 825c7b9 brought
the support for --pgid in rados ls but was not in help.
Fixes: https://tracker.ceph.com/issues/41876

Signed-off-by: Vikhyat Umrao <vumrao@redhat.com>
(cherry picked from commit ae9a24e)
@smithfarm smithfarm force-pushed the smithfarm:wip-41964-mimic branch from 3e8e74f to a52888c Oct 15, 2019
@smithfarm

This comment has been minimized.

Copy link
Contributor Author

smithfarm commented Oct 15, 2019

/home/jenkins-build/build/workspace/ceph-pull-requests/src/tools/rados/rados.cc: In function 'int rados_tool_common(const std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >&, std::vector<const char*>&)':
/home/jenkins-build/build/workspace/ceph-pull-requests/src/tools/rados/rados.cc:3505:64: error: cannot convert 'std::_MakeUniq<ceph::JSONFormatter>::__single_object' {aka 'std::unique_ptr<ceph::JSONFormatter, std::default_delete<ceph::JSONFormatter> >'} to 'ceph::Formatter*' in assignment
       formatter = std::make_unique<JSONFormatter>(pretty_format);
                                                                ^
/home/jenkins-build/build/workspace/ceph-pull-requests/src/tools/rados/rados.cc:3507:55: error: request for member 'get' in 'formatter', which is of pointer type 'ceph::Formatter*' (maybe you meant to use '->' ?)
     ret = do_lock_cmd(nargs, opts, &io_ctx, formatter.get());
                                                       ^~~
/home/jenkins-build/build/workspace/ceph-pull-requests/src/tools/rados/rados.cc: At global scope:
/home/jenkins-build/build/workspace/ceph-pull-requests/src/tools/rados/rados.cc:1165:12: warning: 'int do_lock_cmd(std::vector<const char*>&, const std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >&, librados::IoCtx*, ceph::Formatter*)' defined but not used [-Wunused-function]
 static int do_lock_cmd(std::vector<const char*> &nargs,
            ^~~~~~~~~~~
src/tools/CMakeFiles/rados.dir/build.make:62: recipe for target 'src/tools/CMakeFiles/rados.dir/rados/rados.cc.o' failed
make[3]: *** [src/tools/CMakeFiles/rados.dir/rados/rados.cc.o] Error 1
dragonylffly and others added 2 commits Nov 27, 2018
When connected to ceph cluster, if call exit(1) directly, will cause the finisher
thread segmentation fault as follows,

Caught signal (Segmentation fault) **in thread 7f45377fe700 thread_name:fn_anonymous

run 'rados mapext' without other arguments could easily get it. This patch fixes it
by calling rados.shutdown() before exit()

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

Signed-off-by: Li Wang <laurence.liwang@gmail.com>
(cherry picked from commit 2c14926)

Conflicts:
	src/tools/rados/rados.cc
- revert "std::make_unique" change that, in master, should have been included in
  3804f52 (which is not being backported)
This commit fixes a segmentation fault when using --pgid
option in rados ls command in combination with --pool/-p option.
The reason for the crash was that we can not use the rados object
before connecting it with the cluster using rados.init_with_context().

Fixes: https://tracker.ceph.com/issues/41875

Signed-off-by: Vikhyat Umrao <vumrao@redhat.com>
(cherry picked from commit 56b6dd9)

Conflicts:
	src/tools/rados/rados.cc
@smithfarm smithfarm force-pushed the smithfarm:wip-41964-mimic branch from a52888c to dd78a5a Oct 15, 2019
@smithfarm

This comment has been minimized.

Copy link
Contributor Author

smithfarm commented Oct 15, 2019

@vumrao Please take another look?

@vumrao
vumrao approved these changes Oct 15, 2019
Copy link
Contributor

vumrao left a comment

@smithfarm thank you. LGTM.

@vumrao vumrao changed the title mimic: tools/rados: call pool_lookup() after rados is connected and add --pgid in help mimic: tools/rados: list objects in a pg Oct 15, 2019
@yuriw

This comment has been minimized.

Copy link
Contributor

yuriw commented Oct 17, 2019

@yuriw yuriw merged commit a0b85e9 into ceph:mimic Oct 21, 2019
4 checks passed
4 checks passed
Docs: build check OK - docs built
Details
Signed-off-by all commits in this PR are signed
Details
Unmodified Submodules submodules for project are unmodified
Details
make check make check succeeded
Details
@smithfarm smithfarm deleted the smithfarm:wip-41964-mimic branch Oct 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.