context_impl.go ×3

Frontier kind: Code frontier

unlabeled · c_bf5ba485d186

37 tests · 3322 LOC · 145 files · introduces 0 tests · 33 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
5 ranges33 lines · 3 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
463 ranges3322 lines · 145 files · Browse complete extent
All tests (intent)
37 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.

3 files ranked by introduced lines: 33 introduced LOC across 5 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/shard/context_impl.go 27 introduced LOC · 3 ranges

Open complete file

1158 }
1159
1160 > func (s *ContextImpl) renewRangeLocked(isStealing bool) error { context_impl.go
1161 > // We must drain all in-flight requests before updating the rangeID.
1162 > // This is because requests are conditioned on rangeID, if rangeID
1163 > // is updated before draining them, those requests could fail.
1164 > // This also means renew rangeID will be the only in-flight request
1165 > // when it's issued, so it doesn't matter if semaphore is acquired or not
1166 > // before calling this method.
1167 > s.taskKeyManager.drainTaskRequests()
1168 >
1169 > updatedShardInfo := trimShardInfo(s.config, s.clusterMetadata.GetAllClusterInfo(), s.copyShardInfo(s.shardInfo))
1170 > updatedShardInfo.RangeId++
1171 > if isStealing {
1172 > updatedShardInfo.StolenSinceRenew++
1173 > }
1174
1175 > ctx, cancel := s.newIOContext() context_impl.go
1176 > defer cancel()
1177 >
1178 > previousRangeID := s.getRangeIDLocked()
1179 > err := s.persistenceShardManager.UpdateShard(ctx, &persistence.UpdateShardRequest{
1180 > ShardInfo: updatedShardInfo,
1181 > PreviousRangeID: previousRangeID,
1182 > })
1183 > if err != nil {
1184 // Failure in updating shard to grab new RangeID
1185 s.contextTaggedLogger.Error("Persistent store operation failure",
1967 // in-flight requests before making the call. So it's guaranteed that the renew rangeID
1968 // UpdateShard call is the only one in flight.
1969 > s.wLock() context_impl.go
1970 > err = s.renewRangeLocked(true)
1971 > s.wUnlock()
1972 > if err != nil {
1973 return err
1974 }
go.temporal.io/server/common/log/tag/tags.go 3 introduced LOC · 1 range

Open complete file

563
564 // PreviousShardRangeID returns tag for PreviousShardRangeID
565 > func PreviousShardRangeID(id int64) ZapTag { tags.go
566 > return NewInt64("previous-shard-range-id", id)
567 > }
568
569 // ShardRangeID returns tag for ShardRangeID
go.temporal.io/server/service/history/shard/task_key_manager.go 3 introduced LOC · 1 range

Open complete file

66 }
67
68 > func (m *taskKeyManager) drainTaskRequests() { task_key_manager.go
69 > m.tracker.drain()
70 > }
71
72 func (m *taskKeyManager) setRangeID(