-
Notifications
You must be signed in to change notification settings - Fork 334
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
Add Backfill support to internal statestore #1273
Conversation
1d83c86
to
bcd7b1e
Compare
2e74094
to
68fe81e
Compare
4c0f10d
to
2426154
Compare
2426154
to
a4c9cf0
Compare
a4c9cf0
to
4f8663d
Compare
9090646
to
4e27552
Compare
@Laremere
In this case, we can keep using transactions (WATCH, MULTI) because we have only 1 instance of backfill entity with all information inside.
We need to choose an approach we are going to follow. I can make an update in the upcoming PR. |
The lock approach seems more initially trackable - if we're not locking we need to be very sure there aren't race conditions. If we want to store items in redis that aren't a public proto, that's fine - there's internal protobufs too, which can be used. Need to not only consider the backfills here - when a backfill is acknowledged, the tickets which are acknowledged need to be assigned and then removed from the backfill's pending tickets. |
fa182e4
to
2986ca2
Compare
@Laremere updated PR, please check.
There should be the following flow using statestore:
|
2986ca2
to
39a5569
Compare
}) | ||
} | ||
|
||
// pass an expired context, err expected |
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.
This is a different test, it belongs in its own test function.
Here, and for the other backfill functions.
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.
@Laremere Why? I use high-level names for tests where I include multiple test cases.
For instance - TestCreateBackfill means that I test CreateBackfill under different conditions, and passing an expired context can be considered as another test case.
Exactly the same happens here:
https://github.com/googleforgames/open-match/blob/master/internal/app/frontend/frontend_service_test.go#L45
Expire context scenario is included in a general TestDoCreateTickets function. In my case, I didn't add preAction, but tested expired context case at the end of the function.
If you want to extract expired context test case to its own function it should be done in all tests, not only in backfill_test.go, which can take some time I guess. What do you think?
I faced an issue while using this call in my development branch and test
Attaching commit link for easy navigation. |
add licence header to backfill_test.go
e3c691b
to
3a65e25
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.
Thanks for applying all comments.
What this PR does / Why we need it:
Added Backfill support to internal statestore.
Methods: create, get, delete, update.
Renamed redis.go/redis_test.go to ticket.go/ticket_test.go because now there are 2 entities - ticket and backfill and I find such naming to be more consistent.