Active referrals counts increase only after the decrease active referrals count delay finished between 2 different (non-extended) mining sessions. #47
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Increment t1/t2 active counts are done by processors. Decrement is detected by miner.
Miner handles batches of users, so the delay between
mine()
iteration start and decrementing user'sactive_t1_referrals
/active_t2_referrals
that was detected bydidReferralJustStopMining
function can create the situation,when t1/t2 active count from previous mining session wasn't decremented, but has been already incremented for the new mining session. It happens only when user's session was finished, and then he started new session (not extended). As result t0 can have +1 obsolete
t1_active_count
/t2_active_count
value.To resolve this we need to return 409 duplicate error while t1/t2 referral count from previous session wasn't decreased. On production it can affect up to 9-10 seconds.