Skip to content

Commit f977a1e

Browse files
Add documentation for backfill ticket response
1 parent 664f8ca commit f977a1e

File tree

2 files changed

+33
-18
lines changed

2 files changed

+33
-18
lines changed

site/content/en/docs/Guides/Backfill/_index.md

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,31 @@ Some scenarios that could happen when playing multiplayer games include:
1919

2020
A Match Function example using Backfill can be found [here](https://github.com/googleforgames/open-match/blob/master/examples/functions/golang/backfill/mmf/matchfunction.go).
2121

22-
1. Player creates Ticket (`T1`).
22+
1. Player 1 creates a Ticket (`T1`).
2323
2. Director calls `Backend.FetchMatches` with a MatchProfile.
2424
3. MMF runs `QueryBackfills` and `QueryTickets` using the MatchProfile. It returns `T1`.
25-
4. MMF use `T1`, constructs a new Backfill (`B1`*) and returns a `Match` containing ticket `T1` and Backfill `B1`.
26-
5. Director starts allocating GameServer with Backfill `B1` information.
27-
6. Another player creates a Ticket (`T2`).
25+
4. MMF constructs a new Backfill (`B1`) and returns a `Match` containing ticket `T1` and Backfill `B1`. The Backfill should be created with field `AllocateGameServer` set to `true`, so the game server orchestrator (e.g.: [Agones](https://agones.dev/site/)) knows it has to create a new Game Server. The Director handles making calls to create the Game Server.
26+
5. Director starts allocating a Game Server with Backfill `B1` information.
27+
6. Player 2 creates a Ticket (`T2`).
2828
7. Director calls `Backend.FetchMatches`.
2929
8. MMF runs `QueryBackfills` and `QueryTickets` using the MatchProfile. They return `B1` and `T2` accordingly.
30-
9. MMF determines `B1` could be used because it has open slots available. `T2` and `B1` forms a new Match.
31-
10. When GameServer allocating ends, it starts polling Open Match to acknowledge the backfill with `Frontend.AcknowledgeBackfill` by ID received in the Match (`B1.ID`) and in order to assign the address of the GameServer for `T1` and `T2`.
32-
33-
*: The Backfill should be created with field `AllocateGameServer` set to `true`, so GameServer orchestrator (e.g.: [Agones](https://agones.dev/site/)) knows it has to create a new GameServer.
30+
9. MMF determines `B1` could be used based on data set on `B1` by the last run of the MMF (e.g. a number of open slots). `T2` and `B1` form a new Match.
31+
10. When the Game Server has started, it begins polling Open Match to acknowledge the backfill with `Frontend.AcknowledgeBackfill` using the backfill's ID (`B1.ID`) and supplies connection information for the server, to be returned as the `Assignment` data of the tickets `T1` and `T2`. The Game Server also receives the ticket data of the tickets that were assigned so that any data supplied on the ticket (e.g. player IDs) may be used by the game server.
3432

3533
## Considerations
3634

37-
In order to use Backfill you need to customize your MMF and your Game Servers. BackfillId should be propagated to each Game Server during Game Server allocation. Which would be used later in `AcknowledgeBackfill` requests to define Backfill which is tied to this Game Server.
38-
If Backfill is not being used, no changes are required since the Backfill API doesn't change
39-
the behavior of the current Open Match API state.
35+
In order to use Backfill you need to customize your MMF and your Game Servers. Backfill IDs should be propagated to each Game Server during Game Server allocation to be used in `AcknowledgeBackfill` requests to define Backfill which is tied to the Game Server.
36+
37+
If Backfill is not being used, no changes are required since the Backfill API doesn't change the behavior of the current Open Match API state.
4038

4139
### Acknowledging Backfills
4240

43-
AcknowledgeBackfill is a request, that acts as a periodic ping, made to Open Match Frontend to set the assignment on the tickets associated with this backfill.
44-
GameServer receives current Backfill status as a response.
41+
`AcknowledgeBackfill` is a request made to the Open Match Frontend that serves to notify Open Match that server still interested in the backfill, and to confirm the assignment of the tickets associated with this backfill in the same manner as `Backend.AssignTickets`. The Game Server receives the current Backfill status as well as a list of new tickets that were just acknowledged by the request as a response. The list is not idempotent, but can be appended to prior lists received from `AcknowledgeBackfill`.
4542

46-
GameServers would run `AcknowledgeBackfill` every N seconds, where N is, at most, `backfillTTL` represents 80% of pendingReleaseTimeout and this value MUST always be bigger than N (backfillTTL = 0.8 * pendingReleaseTimeout; N < backfillTTL, where N is AcknowledgeBackfill interval)
43+
GameServers must run `AcknowledgeBackfill` within `backfillTTL` seconds after the Backfill is created and within `backfillTTL` of the last `AcknowledgeBackfill` call after that, where `backfillTTL` is 80% of the pendingReleaseTimeout configuration value.
4744

48-
### Cleaning up Backfills
45+
**Note:** You must keep acknowledging a backfill until it is no longer needed, and if it expires the Backfill object must be recreated and the new ID communicated to the Game Server to begin the `AcknowledgeBackfill` process anew.
4946

50-
This process deletes expired Backfill objects from the state store. Backifll becomes expired if it is not acknowledged in `backfillTTL` period.
47+
### Cleaning up Backfills
5148

52-
Note: you need to keep acknowledging a backfill and if it expires you need to recreate the Backfill object again.
49+
This process deletes expired Backfill objects from the state store. Backfills become expired if they are not acknowledged in the `backfillTTL` period.

site/content/en/docs/Reference/api.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ description:
3939

4040
- [api/frontend.proto](#api/frontend.proto)
4141
- [AcknowledgeBackfillRequest](#openmatch.AcknowledgeBackfillRequest)
42+
- [AcknowledgeBackfillResponse](#openmatch.AcknowledgeBackfillResponse)
4243
- [CreateBackfillRequest](#openmatch.CreateBackfillRequest)
4344
- [CreateTicketRequest](#openmatch.CreateTicketRequest)
4445
- [DeleteBackfillRequest](#openmatch.DeleteBackfillRequest)
@@ -412,6 +413,23 @@ to possible change or removal.
412413

413414

414415

416+
<a name="openmatch.AcknowledgeBackfillResponse"></a>
417+
418+
### AcknowledgeBackfillResponse
419+
BETA FEATURE WARNING: This Request message is not finalized and still subject
420+
to possible change or removal.
421+
422+
423+
| Field | Type | Label | Description |
424+
| ----- | ---- | ----- | ----------- |
425+
| backfill | [Backfill](#openmatch.Backfill) | | The Backfill that was acknowledged. |
426+
| tickets | [Ticket](#openmatch.Ticket) | repeated | All of the Tickets that were successfully assigned |
427+
428+
429+
430+
431+
432+
415433
<a name="openmatch.CreateBackfillRequest"></a>
416434

417435
### CreateBackfillRequest
@@ -570,7 +588,7 @@ The FrontendService implements APIs to manage and query status of a Tickets.
570588
| DeleteTicket | [DeleteTicketRequest](#openmatch.DeleteTicketRequest) | [.google.protobuf.Empty](#google.protobuf.Empty) | DeleteTicket immediately stops Open Match from using the Ticket for matchmaking and removes the Ticket from state storage. The client should delete the Ticket when finished matchmaking with it. |
571589
| GetTicket | [GetTicketRequest](#openmatch.GetTicketRequest) | [Ticket](#openmatch.Ticket) | GetTicket get the Ticket associated with the specified TicketId. |
572590
| WatchAssignments | [WatchAssignmentsRequest](#openmatch.WatchAssignmentsRequest) | [WatchAssignmentsResponse](#openmatch.WatchAssignmentsResponse) stream | WatchAssignments stream back Assignment of the specified TicketId if it is updated. - If the Assignment is not updated, GetAssignment will retry using the configured backoff strategy. |
573-
| AcknowledgeBackfill | [AcknowledgeBackfillRequest](#openmatch.AcknowledgeBackfillRequest) | [Backfill](#openmatch.Backfill) | AcknowledgeBackfill is used to notify OpenMatch about GameServer connection info This triggers an assignment process. BETA FEATURE WARNING: This call and the associated Request and Response messages are not finalized and still subject to possible change or removal. |
591+
| AcknowledgeBackfill | [AcknowledgeBackfillRequest](#openmatch.AcknowledgeBackfillRequest) | [AcknowledgeBackfillResponse](#openmatch.AcknowledgeBackfillResponse) | AcknowledgeBackfill is used to notify OpenMatch about GameServer connection info This triggers an assignment process. BETA FEATURE WARNING: This call and the associated Request and Response messages are not finalized and still subject to possible change or removal. |
574592
| CreateBackfill | [CreateBackfillRequest](#openmatch.CreateBackfillRequest) | [Backfill](#openmatch.Backfill) | CreateBackfill creates a new Backfill object. BETA FEATURE WARNING: This call and the associated Request and Response messages are not finalized and still subject to possible change or removal. |
575593
| DeleteBackfill | [DeleteBackfillRequest](#openmatch.DeleteBackfillRequest) | [.google.protobuf.Empty](#google.protobuf.Empty) | DeleteBackfill receives a backfill ID and deletes its resource. Any tickets waiting for this backfill will be returned to the active pool, no longer pending. BETA FEATURE WARNING: This call and the associated Request and Response messages are not finalized and still subject to possible change or removal. |
576594
| GetBackfill | [GetBackfillRequest](#openmatch.GetBackfillRequest) | [Backfill](#openmatch.Backfill) | GetBackfill returns a backfill object by its ID. BETA FEATURE WARNING: This call and the associated Request and Response messages are not finalized and still subject to possible change or removal. |

0 commit comments

Comments
 (0)