mirror of
https://github.com/googleforgames/open-match.git
synced 2025-03-24 20:35:47 +00:00
Move ignorelists.ttl from Redis section to Open Match core (#1028)
This commit is contained in:
2
Makefile
2
Makefile
@ -371,7 +371,7 @@ install-scale-chart: install-chart-prerequisite build/toolchain/bin/helm$(EXE_EX
|
||||
# install-ci-chart will install open-match-core with pool based mmf for end-to-end in-cluster test.
|
||||
install-ci-chart: install-chart-prerequisite build/toolchain/bin/helm$(EXE_EXTENSION) install/helm/open-match/secrets/
|
||||
$(HELM) upgrade $(OPEN_MATCH_HELM_NAME) $(HELM_UPGRADE_FLAGS) install/helm/open-match $(HELM_IMAGE_FLAGS) \
|
||||
--set redis.ignoreLists.ttl=1000ms \
|
||||
--set open-match-core.ignoreListTTL=1000ms \
|
||||
--set open-match-customize.enabled=true \
|
||||
--set open-match-customize.function.enabled=true \
|
||||
--set open-match-customize.evaluator.enabled=true \
|
||||
|
@ -77,6 +77,7 @@ data:
|
||||
{{- end }}
|
||||
|
||||
storage:
|
||||
ignoreListTTL: {{ index .Values "open-match-core" "ignoreListTTL" }}
|
||||
page:
|
||||
size: 10000
|
||||
|
||||
@ -92,8 +93,6 @@ data:
|
||||
maxActive: {{ index .Values "open-match-core" "redis" "pool" "maxActive" }}
|
||||
idleTimeout: {{ index .Values "open-match-core" "redis" "pool" "idleTimeout" }}
|
||||
healthCheckTimeout: {{ index .Values "open-match-core" "redis" "pool" "healthCheckTimeout" }}
|
||||
ignoreLists:
|
||||
ttl: {{ .Values.redis.ignoreLists.ttl }}
|
||||
expiration: 43200
|
||||
|
||||
telemetry:
|
||||
|
@ -109,8 +109,6 @@ redis:
|
||||
usePassword: false
|
||||
usePasswordFile: false
|
||||
secretMountPath: /opt/bitnami/redis/secrets
|
||||
ignoreLists:
|
||||
ttl: 60000ms
|
||||
configmap:
|
||||
maxclients 100000
|
||||
master:
|
||||
@ -170,6 +168,7 @@ redis:
|
||||
# Controls if users need to install backend, frontend, mmlogic, om-configmap, and swaggerui.
|
||||
open-match-core:
|
||||
enabled: true
|
||||
ignoreListTTL: 60000ms
|
||||
redis:
|
||||
pool:
|
||||
maxIdle: 500
|
||||
|
@ -109,8 +109,6 @@ redis:
|
||||
usePassword: false
|
||||
usePasswordFile: false
|
||||
secretMountPath: /opt/bitnami/redis/secrets
|
||||
ignoreLists:
|
||||
ttl: 60000ms
|
||||
configmap:
|
||||
maxclients 100000
|
||||
master:
|
||||
@ -153,6 +151,7 @@ redis:
|
||||
# Controls if users need to install backend, frontend, mmlogic, om-configmap, and swaggerui.
|
||||
open-match-core:
|
||||
enabled: true
|
||||
ignoreListTTL: 60000ms
|
||||
redis:
|
||||
pool:
|
||||
maxIdle: 200
|
||||
|
@ -436,7 +436,7 @@ func (rb *redisBackend) FilterTickets(ctx context.Context, pool *pb.Pool, pageSi
|
||||
}
|
||||
defer handleConnectionClose(&redisConn)
|
||||
|
||||
ttl := rb.cfg.GetDuration("redis.ignoreLists.ttl")
|
||||
ttl := rb.cfg.GetDuration("storage.ignoreListTTL")
|
||||
curTime := time.Now()
|
||||
curTimeInt := curTime.UnixNano()
|
||||
startTimeInt := curTime.Add(-ttl).UnixNano()
|
||||
|
@ -146,7 +146,7 @@ func TestIgnoreLists(t *testing.T) {
|
||||
verifyTickets(service, len(tickets)-3)
|
||||
|
||||
// Sleep until the ignore list expired and verify we still have all the tickets
|
||||
time.Sleep(cfg.GetDuration("redis.ignoreLists.ttl"))
|
||||
time.Sleep(cfg.GetDuration("storage.ignoreListTTL"))
|
||||
verifyTickets(service, len(tickets))
|
||||
}
|
||||
|
||||
@ -383,7 +383,7 @@ func createRedis(t *testing.T) (config.View, func()) {
|
||||
cfg.Set("redis.pool.healthCheckTimeout", 100*time.Millisecond)
|
||||
cfg.Set("redis.pool.maxActive", 1000)
|
||||
cfg.Set("redis.expiration", 42000)
|
||||
cfg.Set("redis.ignoreLists.ttl", "200ms")
|
||||
cfg.Set("storage.ignoreListTTL", "200ms")
|
||||
cfg.Set("backoff.initialInterval", 100*time.Millisecond)
|
||||
cfg.Set("backoff.randFactor", 0.5)
|
||||
cfg.Set("backoff.multiplier", 0.5)
|
||||
|
@ -34,7 +34,7 @@ func New(t *testing.T, cfg config.Mutable) func() {
|
||||
cfg.Set("redis.pool.maxActive", PoolMaxActive)
|
||||
cfg.Set("redis.pool.idleTimeout", PoolIdleTimeout)
|
||||
cfg.Set("redis.pool.healthCheckTimeout", PoolHealthCheckTimeout)
|
||||
cfg.Set("redis.ignoreLists.ttl", IgnoreListTTL)
|
||||
cfg.Set("storage.ignoreListTTL", IgnoreListTTL)
|
||||
cfg.Set("backoff.initialInterval", InitialInterval)
|
||||
cfg.Set("backoff.randFactor", RandFactor)
|
||||
cfg.Set("backoff.multiplier", Multiplier)
|
||||
|
@ -57,8 +57,8 @@ func TestGameMatchWorkFlow(t *testing.T) {
|
||||
This end to end test does the following things step by step
|
||||
1. Create a few tickets with delicate designs and hand crafted search fields
|
||||
2. Call backend.FetchMatches and verify it returns expected matches.
|
||||
3. Call backend.FetchMatches within redis.ignoreLists.ttl seconds and expects it return a match with duplicate tickets in step 2.
|
||||
4. Wait for redis.ignoreLists.ttl seconds and call backend.FetchMatches the third time, expect the same result as step 2.
|
||||
3. Call backend.FetchMatches within storage.ignoreListTTL seconds and expects it return a match with duplicate tickets in step 2.
|
||||
4. Wait for storage.ignoreListTTL seconds and call backend.FetchMatches the third time, expect the same result as step 2.
|
||||
5. Call backend.AssignTickets to assign DGSs for the tickets in FetchMatches' response
|
||||
6. Call backend.FetchMatches and verify it no longer returns tickets got assigned in the previous step.
|
||||
7. Call frontend.DeleteTicket to delete the tickets returned in step 6.
|
||||
@ -161,11 +161,11 @@ func TestGameMatchWorkFlow(t *testing.T) {
|
||||
var wantTickets = [][]*pb.Ticket{{ticket2, ticket3, ticket4}, {ticket5}}
|
||||
validateFetchMatchesResponse(ctx, t, wantTickets, be, fmReq)
|
||||
|
||||
// 3. Call backend.FetchMatches within redis.ignoreLists.ttl seconds and expects it return a match with ticket1 .
|
||||
// 3. Call backend.FetchMatches within storage.ignoreListTTL seconds and expects it return a match with ticket1 .
|
||||
wantTickets = [][]*pb.Ticket{{ticket1}}
|
||||
validateFetchMatchesResponse(ctx, t, wantTickets, be, fmReq)
|
||||
|
||||
// 4. Wait for redis.ignoreLists.ttl seconds and call backend.FetchMatches the third time, expect the same result as step 2.
|
||||
// 4. Wait for storage.ignoreListTTL seconds and call backend.FetchMatches the third time, expect the same result as step 2.
|
||||
time.Sleep(statestoreTesting.IgnoreListTTL)
|
||||
wantTickets = [][]*pb.Ticket{{ticket2, ticket3, ticket4}, {ticket5}}
|
||||
validateFetchMatchesResponse(ctx, t, wantTickets, be, fmReq)
|
||||
|
Reference in New Issue
Block a user