-
Notifications
You must be signed in to change notification settings - Fork 333
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
Feature Request: Backfill Support #1240
Comments
Thanks for opening this issue and adding some context to the problems associated with backfilling. I would also like add a few situations where I think backfilling will be required by game servers so we can be sure to hit as many of the primary use cases as possible. Feel free to add more use-cases if I missed any.
Also, thanks to @andrewgrundy for help with coming up with the list. |
I reviewed the list of backfill situations I presented in my last comment and added technical requirements that would be needed to support each of them. My requirements might be a little opinionated because I was thinking of a certain implementation when I wrote them, so please let me know if you think there are any missing requirements, or if they should change in some way. Situation:Player(s) drop out of an existing game therefore substitute(s) are required Support Needed in Open Match:
Situation:Player(s) who were matched into a server do not ever attempt to connect. The server decides they are no longer going to join, and advertises open spaces. Support Needed in Open Match:
Situation:Player(s) create game(s), set the rules, the map etc and search for participants Support Needed in Open Match:
Situation:A game is created above minimum required players, but below capacity and remaining spaces are advertised Support Needed in Open Match:
Situation:A party partially fill a team and require other players / teams to join them in order to proceed Support Needed in Open Match:
Situation:A long running world server has players leave therefore substitute(s) are required Support Needed in Open Match:
Situation:The available capacity of world servers causes more instances to be scaled up; these spaces are then advertised Support Needed in Open Match:
Situation:A game server that has previously advertised its backfill slots has players join it through mechanisms other than Open Match (via a party system, or social platform, for instance). Support Needed in Open Match:
|
I wrote up some implementation ideas that I think will allow us to satisfy the requirements I detailed in my last comment. Feel free to add pros and cons, or add your own ideas to these as well. Idea: Server Backfill Ticket (single ticket representing all open slots)DescriptionThis approach views Open Match as a clearing house where you have tickets indicating demand for matches coming in from game clients, and tickets representing supply coming from game servers. Open Match then matches demand with supply. This description is to help readers understand where the idea came from, not to describe how it works in absolute terms. Open Match will still default to making matches between players, even if there are no "supply" tickets; it is assumed that when matches are made, there will be a place for them to go to. The addition of game server generated backfill tickets is to help game servers that desire backfill to get prioritized during matchmaking. The game server will create a backfill ticket when it wants players matched into it, when a game session is already running. The backfill ticket will indicate the match profile that the game server is running (and possibly other parameters to help make sure the most relevant clients join), the server connection details, the number of players already playing, and the number of additional players desired. The backfill tickets also contain some other info in them that allows Match Profiles to define Pools for them. When matchmaking runs the MMF will query Open Match for the Pools associated with the Match Profile. The backfill tickets will be put into a Pool as a result. The MMF then needs to evaluate the backfill tickets, and see if any of the players in the other Pools satisfy the backfill tickets. If they do, then a match is made with the player and backfill tickets, and given a high score so the Evaluator prioritizes backfill matches. The Director or Allocator/RM would then skip asking Agones for a game server, and return the backfill ticket's server connection data when a client from the match asks for connection data. Pros
Cons
Idea: Server Backfill Ticket (1 ticket per open slot)DescriptionThis is similar to the previous approach, except instead of having 1 ticket that has a field for the number of open slots on the server, there would be 1 ticket per open slot, and these tickets representing slots would no longer exist after being added to a match. Pros
Cons
Idea: New Backfill Request API (new data type, not tickets)DescriptionGame servers will make a Backfill Request to Open Match, providing the Match Profile name that they are currently running, number of available slots, TTL, connection info, etc, to Open Match. The Backfill Requests will be provided to MMFs as an additional argument that they can consider when making matches. If a match is for backfill, it gets additional info indicating connection settings, and the backfill request ID. When the Evaluator is going through matches, if it allows a backfill proposal, it adjusts the number of open slots remaining on the backfill request. If no more slots are available after the decrement, the backfill request would be deleted. There would also be an API available to allow game servers to cancel their backfill requests, or update them with a different slot count. Pros
Cons
Idea: Server Generated Match ProfilesDescriptionThe game server registers a new Match Profile with Open Match when it wants players backfilled into it. The backfill Match Profile would include server connection details in it that could be used later during the game server allocation process. The Match Profile would also have a weight in it that would be added to the matches made, and would also have a TTL defined, after which time it would no longer be run. The Match Profile would need to run against an existing MMF that knew how to handle making matches for it. Pros
Cons
|
Throwing some numbers out there: If backfills are tickets, the number of tickets transmitted to match function requests is: However if backfill requests are additional profile runs, suddenly: These are random numbers, but show how making backfill profiles become a very large factor quickly, making the system sensitive overall. There would have to be additional work on methods to reduce this. The backfill requests would need to do a very good job of estimating what ranges it should search for to only get a few tickets, or the query logic would have to be extended to support some method of rating, ordering, and limiting. That's also not considering the information locality which a MMF having multiple backfills could support: If it already uses a ticket for one backfill, it can choose to not use that ticket for other matches or backfills. If they ran in seperate profiles, either backfills would have to be greedy and send a lot of matches to the evaluator to try and get one through, or there's good chance of collision and wasting cycles colliding with other backfill MMF runs. |
@adumovic ping |
@Laremere - thanks for providing an illustration of the extra load the "Server Generated Match Profile" approach would introduce. I agree that this approach is probably not the direction we want to go in. |
Sorry i am late to the party! We have done a few internal implementations of backfill with our version of open match have a some learnings i think would be useful to this discussion (and indeed, guided our current implementation of backfill). First of all, we tried a few approaches (both on paper and some as actual SPIKEs/POCs). One of the one that is ostensibly the easiest, is using the existing concept of a ticket to represent backfill tickets as well. When trying to implement backfill tickets reusing the existing ticket system, there were a few things that stuck out as blockers right away: In the existing ticket system, tickets are immutable. There are good reasons why tickets are immutable, and a lot of performance and coordination freebies from having immutable tickets! Imagine if all the om-query cache layers have to suddenly worry about not only caching but caching the right version of a ticket (and guaranteeing synchronous access for reads/writes) The other thing we quickly realized was that we could not achieve our primary goals without mutable backfill tickets.
The main benefits of this approach were that servers were fully responsible for approving backfill tickets depending on their state, and functions could author whatever they wanted and represent the backfill ticket with any data they chose. Servers then just need to check in to approve or update the ticket before the proposed ticket assignments expired. If desired we can share more details about the specifics our implementation. I want to take some time to weight in on the existing proposals here. |
This flow is very similar to the approach we took, in that match functions get to observer tickets and backfill tickets and match them together.
I think this is problematic since you can't prevent many servers to be allocated at the same time as they don't know about eachother until these new tickets are created, in the meantime, more servers may sneak in, causing an explosion of tickets representing open slots
This is very very similar to what we ended up implementing.
As @Laremere has already noted, more match profiles can lead to a lot of extra executions. I think the idea of having them be profiles made on demand would limit the possibility of this but still have noticeable increase in load. General Feedback:In general, we could not think of a single solution that involved creating backfill tickets only outside of the matchmaker that solved the immediacy problem |
Thanks for your feedback on the ideas I had @adumovic ! Question:
What benefits do you get by allowing the match functions to query the backfill tickets as opposed to just providing the relevant backfill tickets (the backfill tickets associated with a match profile) to the match function? |
+1, this seems like the most fruitful way to move forward. I'm not as worried about bugs, we have good test coverage. However, if backfill api ends up being a super set (or nearly so) to tickets once we get a concrete API draft, I'm going to question whether we should move the logic into tickets. I like the idea of unconstrained thinking with the API first though, so start with that. |
BackfillTicket should contain GS data and MatchProfile also. |
Sharing the diagram which was presented on a Contributors Meeting:
Another Option on a graph marked as Option 2:I assume one other option which @adumovic explained is just not to return the assignment, create |
Gathering some answers after discussion with Scott and Andy. In the form of meeting notes. A subject to correction.
A concepts of bags inside Backfill Ticket was introduced, contain the number of tickets which could be used to Backfill. MMF if new state of BF ticket is accepted, it goes into that BF ticket. |
There is a draft sequence diagram for first two tickets and one BF tickets created. Some arrows under questions marked with cross. I am not sure would DGS poll Backfill API to see if it has new tickets which need to be approved or accepted by DGS. |
I totally agree with the approach provided by Scott. I was thinking of similar way of changing the state of Backfill Ticket to unavailable for some time, while one Director acquired and locked it as a mutex. In this case for allocating GS. |
As mentioned on slack, we had a good meeting this morning diving into the current details and proposals. |
Also, in our discussion it was pointed out that Game Servers receiving a request to accept matches is a non-starter, which invalidates my proposal from yesterday. My new version of the design, mostly going off of previous designs but modifying to meet our discussion today: https://docs.google.com/document/d/1wUdFHoFTybQrzIlpK_oCV_EIBFbDIpY6A1vklfgiR0Y/edit# |
Hi. I don't see any field in the Backfill message to determine how many players need to be filled. Is there any way to solve this? (or use the extensions field?). |
We decided not to have separate fields other than those in a regular Ticket. You should use Extensions for this and write MMF to treat those Extensions right. |
I have created a list of tests we can run in order to determine what kind of performance we can expect when using Backfill to place players in matches. We can also use the results of these tests to measure how much Open Match's performance is changing from release to release. Feel free to leave comments if you think any of the tests don't make sense, or need to be modified. Thanks! https://docs.google.com/document/d/1c32YB0UzsM1Tm9XUDxWriclYhuP6PRTk6ol5mzgQoU4/edit?usp=sharing |
I am adding more description with answers for FAQ and other interesting details here:
|
Hi. I tried the Backfill feature in v1.2.0-rc. I used the "openSlots" extension key to specify the number of players for the backfill, referring to examples. It almost works! However, there is one case that is not taken into account in the examples: in the MatchFunction, calling setOpenSlots does not always guarantee that the player will reach the GameServer afterwards. The code I have tested is below. I'd like to hear your opinions on this issue. Thanks! |
In the even a player doesn’t reach the game server, the game server can create another backfill to fill the slot. In the even the original backfill was for multiple slots, the game server can update the existing backfill adding +1 to the number of available slots.
… On 23 Apr 2021, at 04:07, castaneai ***@***.***> wrote:
Hi. I tried the Backfill feature in v1.2.0-rc.
I used the "openSlots" extension key to specify the number of players for the backfill, referring to examples. It almost works!
However, there is one case that is not taken into account in the examples: in the MatchFunction, calling setOpenSlots does not always guarantee that the player will reach the GameServer afterwards.
Strictly speaking, do we need to acquire a lock on the slots with a timeout? We have adopted the method of calling setOpenSlots after a player connects to the GameServer. This method sometimes causes player overflow, but the GameServer detects it and kicks the overflowing players out of the room to avoid the problem. This idea is based on Eventual Consistency.
The code I have tested is below.
https://github.com/castaneai/openmatch-local-dev/blob/backfill/tests/backfill_test.go <https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_castaneai_openmatch-2Dlocal-2Ddev_blob_backfill_tests_backfill-5Ftest.go&d=DwMCaQ&c=RKDswobrOGdp5vDCbl5XjxW8HqrsRSr80dGTvu3rE9Q&r=OiIm2MnYkasytSfnek08hoZLrVOOUEPyq8ouViqN00Q&m=v6DaRJqZwXEtGk2UM7krTeuaA_C6ioI-ox9FRNtWuAo&s=04jmOQNon9JVE0o7cjlHHbbLkHG_FO7NuoJvYJhFQW0&e=>
I'd like to hear your opinions on this issue. Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_googleforgames_open-2Dmatch_issues_1240-23issuecomment-2D825353888&d=DwMCaQ&c=RKDswobrOGdp5vDCbl5XjxW8HqrsRSr80dGTvu3rE9Q&r=OiIm2MnYkasytSfnek08hoZLrVOOUEPyq8ouViqN00Q&m=v6DaRJqZwXEtGk2UM7krTeuaA_C6ioI-ox9FRNtWuAo&s=wBYb9-0xIYq_TuoM2ADJjbsWxQ0wSu9zdz7tRIXv2Ss&e=>, or unsubscribe <https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AQFD5INC55CEJLLVEXMGQQLTKDP7VANCNFSM4PL27ITA&d=DwMCaQ&c=RKDswobrOGdp5vDCbl5XjxW8HqrsRSr80dGTvu3rE9Q&r=OiIm2MnYkasytSfnek08hoZLrVOOUEPyq8ouViqN00Q&m=v6DaRJqZwXEtGk2UM7krTeuaA_C6ioI-ox9FRNtWuAo&s=xkFhO1dKn5DJWVONKQRfBvMZwioBxvmg2XOhd3Px1pQ&e=>.
|
Is your feature request related to a problem? Please describe.
Matches can be created without being full. At the same time, matches that were “full,” can have changing rosters from the perspective of the game host. Developers need a way to fill partially full matches. Additionally, the reasons and criteria used to fill matches change over time as the game progresses (e.g. highly skilled players leave one team, a friend has joined from outside matchmaking, etc).
For users of the matchmaker, solving this backfill problem should result in quicker times to match, and matches that are filled with more players; it will be more likely that any joined server will be full or quickly filled. From a developer perspective, it is very hard to work with a backfill system that competes with tickets being allocated to new servers. Methods to achieve this generally take the form of introducing lag to compensate for startup delay of servers, and failure to do so correctly can break matchmaking or overwhelm the system.
Here are a few common issues associated with directly running a match function as a backfill request:
Backfill Storms - If backfilling encounters issues that prevent successful backfill for a short period, matchmaking generates new game hosts since players aren't being drained into existing games. The game hosts start and try backfilling, resulting in further failure. More game hosts. More failed backfills. If left unresolved, the issue balloons and eventaully becomes a scale problem. Etc. Etc. This is especially problematic for long running game hosts (like lobby servers or mmos)
Immediacy Problem - Servers scheduled for allocation need to be immediately available for backfill. Without this, during the lag between a server allocation request and it coming online for backfill requests, many extraneous servers can be created leading to a cascading effect that can lead to service failure and extremely sparse server density.
Player Density - Similarly to the immediacy problem above, backfill requests that aren’t processed during every match function window are missed and can result in new matches being created despite having partially full games. This decreases the ability for the developer to fill those games, and ultimately ties game-host player-density directly to the rate at which a game developer is able to meet the matchmaking sync windows. This necessitates the need for some state to exist in the matchmaker to be available during matchmaking windows on a consistently recurring basis.
Describe the solution you'd like
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: