-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
src/mon/ConnectionTracker.cc: Fix dump function #57146
base: main
Are you sure you want to change the base?
src/mon/ConnectionTracker.cc: Fix dump function #57146
Conversation
Problem: Currently, the ConnectionTracker::dump() will dump a duplicate key which is not ideal when you want to write a test that converts the dump into a JSON since JSON objects are key-value pairs where each key must be unique. Solution: Use open_array_section and convert `peer_scores` and `reports` into an array instead. Fixes: https://tracker.ceph.com/issues/65695 Signed-off-by: Kamoltat <ksirivad@redhat.com>
teuthology run on the newly added integration test: 1/1 Passed |
jenkins test api |
d0f55ef
to
143fe58
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM apart from a questionable case (see comments)
return | ||
else: | ||
if elapsed >= timeout: | ||
if check_fn and check_fn() and retry_count < 5: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check_fn is allowed to be null, right? I am not sure that's handled correctly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, it's allowed to be null, basically, the check_fn part allows the function to keep looping if we determine that the actual thing that we are checking is making progress.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I was trying to ask:
suppose there's no check_fn. I wanted to make sure you really meant to ignore the ' retry_count'
(I guess that makes sense, anyway).
Basically when we deploy a 3 MONS Check if the connection scores are clean with a 60 seconds grace period Fixes: https://tracker.ceph.com/issues/65695 Signed-off-by: Kamoltat <ksirivad@redhat.com>
143fe58
to
842f8b3
Compare
@ronen-fr all of your comments should be addressed in the new commit, let me know what you think! Thank you so much for your review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(note my followup question)
Problem:
Currently, the ConnectionTracker::dump()
will dump a duplicate key which is not
ideal when you want to write a test that
converts the dump into a JSON since
each key must be unique. Basically without resolving this,
you cannot do something like:
json.load(connection_score) because the dump is not a valid JSON format
e.g.,
ceph daemon mon.a connection scores dump
peer
is a duplicate key.report
is a duplicate keySolution:
Use open_array_section and convert
peer_scores
andreports
into anarray instead.
peer
is no longer a duplicate.report
is no longer a duplicateTest:
Added some tests to verify that our connection score is clean and to also verify that we can actually load the dump into a JSON format.
Fixes: https://tracker.ceph.com/issues/65695
Signed-off-by: Kamoltat ksirivad@redhat.com
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
x
between the brackets:[x]
. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins retest this please
jenkins test classic perf
jenkins test crimson perf
jenkins test signed
jenkins test make check
jenkins test make check arm64
jenkins test submodules
jenkins test dashboard
jenkins test dashboard cephadm
jenkins test api
jenkins test docs
jenkins render docs
jenkins test ceph-volume all
jenkins test ceph-volume tox
jenkins test windows
jenkins test rook e2e