replication_task.go ×4

Frontier kind: Code frontier

unlabeled · c_31f38a840b5b

7 tests · 2680 LOC · 136 files · introduces 0 tests · 53 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
5 ranges53 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
393 ranges2680 lines · 136 files · Browse complete extent
All tests (intent)
7 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: 53 introduced LOC across 5 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/ndc/replication_task.go 50 introduced LOC · 4 ranges

Open complete file

177 versionedTransition *persistencespb.VersionedTransition,
178 isStateBased bool,
179 > ) (*replicationTaskImpl, error) { replication_task.go
180 >
181 > versionHistory := &historyspb.VersionHistory{
182 > BranchToken: nil,
183 > Items: versionHistoryItems,
184 > }
185 >
186 > firstBlob := eventsSlice[0]
187 > lastBlob := eventsSlice[len(eventsSlice)-1]
188 >
189 > firstEvent := firstBlob[0]
190 > lastEvent := lastBlob[len(lastBlob)-1]
191 > version := firstEvent.GetVersion()
192 >
193 > sourceCluster := clusterMetadata.ClusterNameForFailoverVersion(true, version)
194 >
195 > eventTime := time.Time{}
196 > for _, events := range eventsSlice {
197 > for _, event := range events {
198 > eventTime = util.MaxTime(eventTime, timestamp.TimeValue(event.GetEventTime()))
199 > }
200 }
201 > for _, event := range newEvents { replication_task.go
202 eventTime = util.MaxTime(eventTime, timestamp.TimeValue(event.GetEventTime()))
203 }
204
205 > if len(newEvents) != 0 && newRunID == "" { replication_task.go
206 // This is for backward compatibility, old replication tasks generated for continuedAsNew case
207 // doesn't have newRunID field set. In that case, we need to get newRunID from the last event.
213 }
214
215 > logger = log.With( replication_task.go
216 > logger,
217 > tag.WorkflowID(workflowKey.WorkflowID),
218 > tag.WorkflowRunID(workflowKey.RunID),
219 > tag.SourceCluster(sourceCluster),
220 > tag.IncomingVersion(version),
221 > tag.WorkflowFirstEventID(firstEvent.GetEventId()),
222 > tag.WorkflowNextEventID(lastEvent.GetEventId()+1),
223 > )
224 >
225 > return &replicationTaskImpl{
226 > sourceCluster: sourceCluster,
227 > workflowKey: workflowKey,
228 > version: version,
229 > firstEvent: firstEvent,
230 > lastEvent: lastEvent,
231 > eventTime: eventTime,
232 > baseWorkflowInfo: baseExecutionInfo,
233 > versionHistory: versionHistory,
234 > events: eventsSlice,
235 > newEvents: newEvents,
236 > newRunID: newRunID,
237 > versionedTransition: versionedTransition,
238 > isStateBased: isStateBased,
239 >
240 > logger: logger,
241 > }, nil
242 }
243
go.temporal.io/server/common/log/tag/tags.go 3 introduced LOC · 1 range

Open complete file

816
817 // IncomingVersion returns tag for IncomingVersion
818 > func IncomingVersion(incomingVersion int64) ZapTag { tags.go
819 > return NewInt64("xdc-incoming-version", incomingVersion)
820 > }
821
822 // FirstEventVersion returns tag for FirstEventVersion