-
Notifications
You must be signed in to change notification settings - Fork 326
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
Count team members using es #1046
Conversation
One place it is difficult to do is the journaler binary as it doesn't talk to brig as of now.
a17b33b
to
bdcbc00
Compare
Whoops, didn't expect spar to break. Fixing it now. |
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.
I have read everything but the integration tests. Looks good so far, but it has conflicts with #1029.
let sizeAfterDelete = | ||
if sizeBeforeDelete == 0 | ||
then 0 | ||
else sizeBeforeDelete - 1 |
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.
hum, this does not inspire a lot of trust... but i have no idea how to make this better. :(
so if the same thing happens between 1809 and 1810 instead of 0 and 1, the result will be off by one?
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.
I don't understand what you mean by 1809 and 1810. Can you please explain?
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.
i mean that if you run into this race condition with number higher than 1 and 0, this will just silently get the count wrong by 1.
Does this accumulate? So every time we enter the count becomes less accurate?
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.
Yes, this can be off by more than 1, if a lot of people join/leave the team within a very short time (seconds), we are bound to get this number wrong.
Default to 1 if ES says team has 0 users.
Also * Add assertions on error labels * Simplify randomUser functions
Fixes https://github.com/zinfra/backend-issues/issues/1207