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

Make filtering orchestrators that haven't been updated in last day optional #2073

Merged
merged 4 commits into from
Oct 27, 2021

Conversation

yondonfu
Copy link
Member

@yondonfu yondonfu commented Oct 26, 2021

What does this pull request do? Explain your changes. (required)

This PR addresses #1482.

Based on the OP in the above issue and this comment I suspect the problem is that all orchestrator table queries will filter out any orchestrator entries that have not been updated in the last day. I had previously thought that existing orchestrator entries would be updated at least once a day when a new round is initialized as mentioned here. I'm still not sure why this wouldn't be happening. But, the screenshot provided in the OP of #1482 does indicate a updatedAt timestamp that is more than 1 day in the past which would explain the failed active check - the updatedAt timestamp was from 4/30/20 and the active check started failing on 5/5/20. Note: I'm assuming that the DB dump in that post was created on or after 5/5/20.

So, the updatedAt check is my best guess of the problem right now and this PR disables the updatedAt check unless it is explicitly enabled using DBOrchFilter.UpdatedLastDay. The check is explicitly enabled in DBOrchestratorPoolCache when deciding which orchestrators to query in order to preserve existing behavior for now - changes to this behavior can be considered separately.

Also included some additional logging around the active check for informational purposes in case there is an additional problem in addition to the updatedAt check.

Specific updates (required)

See commit history.

How did you test each of these updates (required)

Added unit tests.

Does this pull request close any open issues?

Fixes #1482

Checklist:

@@ -822,29 +823,40 @@ func buildOrchCountQuery(filter *DBOrchFilter) (string, error) {
}

func buildFilterOrchsQuery(filter *DBOrchFilter) (string, error) {
qry := "WHERE updatedAt >= datetime('now','-1 day')"
qry := ""
var filters []string
Copy link
Member Author

Choose a reason for hiding this comment

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

Switched to joining a slice of strings with the " AND " delimiter because it is possible that we end up with a query without a WHERE clause or any ANDs.

Copy link
Contributor

@darkdarkdragon darkdarkdragon left a comment

Choose a reason for hiding this comment

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

LGTM

@yondonfu yondonfu merged commit f59cbd5 into master Oct 27, 2021
@yondonfu yondonfu deleted the yf/active-fix branch October 27, 2021 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"error processing payment: orchestrator is inactive" -> but orchestrator is active
2 participants