db.go ×3

Frontier kind: Code frontier

unlabeled · c_48a61be0c799

198 tests · 3480 LOC · 150 files · introduces 0 tests · 22 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
4 ranges22 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
564 ranges3480 lines · 150 files · Browse complete extent
All tests (intent)
198 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

2 files ranked by introduced lines: 22 introduced LOC across 4 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/matching/db.go 11 introduced LOC · 3 ranges

Open complete file

364 }
365
366 > func (db *taskQueueDB) updateFairAckLevel(subqueue subqueueIndex, newAckLevel fairLevel, countDelta, knownCount int64, oldestTime time.Time) { db.go
367 > db.Lock()
368 > defer db.Unlock()
369 >
370 > db.lastChange = time.Now()
371 > dbQueue := db.subqueues[subqueue]
372 > if prev := fairLevelFromProto(dbQueue.FairAckLevel); newAckLevel.less(prev) {
373 softassert.Fail(db.logger,
374 "ack level in subqueue should not move backwards",
377 tag.Any("new-ack-level", newAckLevel))
378 }
379 > dbQueue.FairAckLevel = newAckLevel.toProto() db.go
380 >
381 > if knownCount >= 0 {
382 // Reset approximateBacklogCount to fix the count divergence issue
383 dbQueue.ApproximateBacklogCount = knownCount
384 dbQueue.oldestTime = oldestTime
385 > } else if countDelta != 0 { db.go
386 db.updateBacklogStatsLocked(subqueue, countDelta, oldestTime)
387 }
go.temporal.io/server/service/matching/fair_backlog_manager.go 11 introduced LOC · 1 range

Open complete file

120 }
121
122 > c.subqueueLock.Lock() fair_backlog_manager.go
123 > for i, r := range c.subqueues {
124 > _, ackLevel := r.getLevels()
125 > // oldestTime can be time.Time{} here since countDelta is 0
126 > c.db.updateFairAckLevel(subqueueIndex(i), ackLevel, 0, -1, time.Time{})
127 > }
128 > c.subqueueLock.Unlock()
129 >
130 > ctx, cancel := context.WithTimeout(c.tqCtx, ioTimeout)
131 > _ = c.db.SyncState(ctx)
132 > cancel()
133 }
134