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

vstart.sh: wait for mgr to be active before running cmds #16556

Closed
wants to merge 1 commit into from

Conversation

jecluis
Copy link
Member

@jecluis jecluis commented Jul 25, 2017

If we don't wait for the mgr to become active, we'll be racing when
running mgr-specific commands and the monitors may not know what to do
with them.

Signed-off-by: Joao Eduardo Luis joao@suse.de

If we don't wait for the mgr to become active, we'll be racing when
running mgr-specific commands and the monitors may not know what to do
with them.

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
Copy link
Member

@theanalyst theanalyst left a comment

Choose a reason for hiding this comment

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

worked for me,

break
fi
echo "Waiting for MGR to become active."
waited_for=$((`date +%s` - wait_active_start))
Copy link
Contributor

@wjwithagen wjwithagen Jul 25, 2017

Choose a reason for hiding this comment

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

I really do not like this construct.
In other scripts the sequence is something like

for w in \`seq 1 $timeout}\`; do .....; if oke; then break; done

And as such obvious need to work with date +%s and math

Also printing "Waiting ...." every sec is going to uselessly polute the output log

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, i'll rework the patch. tbh, this was a nasty quick kludge to get my day starting ;)

@liewegas
Copy link
Member

fwiw using 'ceph tell mgr ' accomplishes the same thing.

or issugin any other statically-defined mgr command (e.g., 'ceph pg stat') first so that we block for mgr startup.

see #16564

@jecluis
Copy link
Member Author

jecluis commented Jul 25, 2017

I like sage's solution better. Please see #16564

@jecluis jecluis closed this Jul 25, 2017
@jecluis jecluis deleted the wip-fix-vstart-mgr branch July 25, 2017 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants