user_data_manager.go ×5

Frontier kind: Code frontier

unlabeled · c_ed4763fdb12b

47 tests · 3277 LOC · 152 files · introduces 0 tests · 26 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges26 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
544 ranges3277 lines · 152 files · Browse complete extent
All tests (intent)
47 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: 26 introduced LOC across 7 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/matching/user_data_manager.go 18 introduced LOC · 5 ranges

Open complete file

531 return nil, false, serviceerror.NewFailedPreconditionf("user data version mismatch: requested: %d, current: %d", options.KnownVersion, preUpdateVersion)
532 }
533 > updatedUserData, shouldReplicate, err := updateFn(preUpdateData) user_data_manager.go
534 > if err == errUserDataUnmodified || err == errFairnessOverridesUpdateRejected {
535 return userData, false, err
536 }
537 > if err != nil { user_data_manager.go
538 m.logger.Error("user data update function failed", tag.Error(err), tag.String("user-data-update-source", options.Source))
539 return nil, false, err
540 }
541
542 > added, removed := GetBuildIdDeltas(preUpdateData.GetVersioningData(), updatedUserData.GetVersioningData()) user_data_manager.go
543 > if options.TaskQueueLimitPerBuildId > 0 && len(added) > 0 {
544 // We iterate here but in practice there should only be a single build Id added when the limit is enforced.
545 // We do not enforce the limit when applying replication events.
558 }
559
560 > _, err = m.matchingClient.UpdateTaskQueueUserData(ctx, &matchingservice.UpdateTaskQueueUserDataRequest{ user_data_manager.go
561 > NamespaceId: m.partition.NamespaceId(),
562 > TaskQueue: m.partition.TaskQueue().Name(),
563 > UserData: &persistencespb.VersionedTaskQueueUserData{Version: preUpdateVersion, Data: updatedUserData},
564 > BuildIdsAdded: added,
565 > BuildIdsRemoved: removed,
566 > })
567 > if err != nil {
568 m.logger.Error("failed to push new user data to owning matching node for namespace", tag.Error(err))
569 return nil, false, err
570 }
571
572 > updatedVersionedData := &persistencespb.VersionedTaskQueueUserData{Version: preUpdateVersion + 1, Data: updatedUserData} user_data_manager.go
573 > m.logNewUserData("modified user data", updatedVersionedData, tag.String("user-data-update-source", options.Source))
574 > m.setUserDataLocked(updatedVersionedData)
575 >
576 > return updatedVersionedData, shouldReplicate, err
577 }
578
go.temporal.io/server/api/matchingservicemock/v1/service_grpc.pb.mock.go 8 introduced LOC · 2 ranges

Open complete file

824
825 // UpdateTaskQueueUserData mocks base method.
826 > func (m *MockMatchingServiceClient) UpdateTaskQueueUserData(ctx context.Context, in *matchingservice.UpdateTaskQueueUserDataRequest, opts ...grpc.CallOption) (*matchingservice.UpdateTaskQueueUserDataResponse, error) { service_grpc.pb.mock.go
827 > m.ctrl.T.Helper()
828 > varargs := []any{ctx, in}
829 > for _, a := range opts {
830 varargs = append(varargs, a)
831 }
832 > ret := m.ctrl.Call(m, "UpdateTaskQueueUserData", varargs...) service_grpc.pb.mock.go
833 > ret0, _ := ret[0].(*matchingservice.UpdateTaskQueueUserDataResponse)
834 > ret1, _ := ret[1].(error)
835 > return ret0, ret1
836 }
837