namespace_replication_queue.go ×15

Frontier kind: Code frontier

unlabeled · c_402ddb0eb48c

14 tests · 3988 LOC · 177 files · introduces 0 tests · 44 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
17 ranges44 lines · 3 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
706 ranges3988 lines · 177 files · Browse complete extent
All tests (intent)
14 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: 44 introduced LOC across 17 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/common/persistence/namespace_replication_queue.go 34 introduced LOC · 15 ranges

Open complete file

167 clusterName string,
168 isDLQ bool,
170 > conditionFailedRetry:
171 > for {
172 > err := q.updateAckLevel(ctx, lastProcessedMessageID, clusterName, isDLQ)
173 > switch err.(type) {
174 case *ConditionFailedError:
175 continue conditionFailedRetry
176 }
177
179 }
180 }
185 clusterName string,
186 isDLQ bool,
188 > var ackLevelErr error
189 > var internalMetadata *InternalQueueMetadata
190 > if isDLQ {
191 internalMetadata, ackLevelErr = q.queue.GetDLQAckLevels(ctx)
193 internalMetadata, ackLevelErr = q.queue.GetAckLevels(ctx)
194 }
195
196 > if ackLevelErr != nil { namespace_replication_queue.go
197 return ackLevelErr
198 }
199
200 > ackLevels, err := q.ackLevelsFromBlob(internalMetadata.Blob) namespace_replication_queue.go
201 > if err != nil {
202 return err
203 }
204
205 // Ignore possibly delayed message
206 > if ack, ok := ackLevels[clusterName]; ok && ack >= lastProcessedMessageID { namespace_replication_queue.go
207 return nil
208 }
209
210 // update ack level
211 > ackLevels[clusterName] = lastProcessedMessageID namespace_replication_queue.go
212 > blob, err := q.serializer.QueueMetadataToBlob(&persistencespb.QueueMetadata{
213 > ClusterAckLevels: ackLevels,
214 > })
215 > if err != nil {
216 return err
217 }
218
219 > internalMetadata.Blob = blob namespace_replication_queue.go
220 > if isDLQ {
221 err = q.queue.UpdateDLQAckLevel(ctx, internalMetadata)
223 err = q.queue.UpdateAckLevel(ctx, internalMetadata)
224 }
225 > if err != nil { namespace_replication_queue.go
226 return fmt.Errorf("failed to update ack level: %v", err)
227 }
228
230 }
231
240 }
241
242 > func (q *namespaceReplicationQueueImpl) ackLevelsFromBlob(blob *commonpb.DataBlob) (map[string]int64, error) { namespace_replication_queue.go
243 > if blob == nil {
244 return make(map[string]int64), nil
245 }
246
247 > metadata, err := q.serializer.QueueMetadataFromBlob(blob) namespace_replication_queue.go
248 > if err != nil {
249 return nil, err
250 }
251 > ackLevels := metadata.ClusterAckLevels namespace_replication_queue.go
252 > if ackLevels == nil {
253 > ackLevels = make(map[string]int64)
254 > }
255 > return ackLevels, nil
256 }
257
go.temporal.io/server/api/persistence/v1/queue_metadata.pb.go 6 introduced LOC · 1 range

Open complete file

31 }
32
33 > func (x *QueueMetadata) Reset() { queue_metadata.pb.go
34 > *x = QueueMetadata{}
35 > mi := &file_temporal_server_api_persistence_v1_queue_metadata_proto_msgTypes[0]
36 > ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
37 > ms.StoreMessageInfo(mi)
38 > }
39
40 func (x *QueueMetadata) String() string {
go.temporal.io/server/common/persistence/serialization/serializer.go 4 introduced LOC · 1 range

Open complete file

567 }
568
569 > func (t *serializerImpl) QueueMetadataFromBlob(data *commonpb.DataBlob) (*persistencespb.QueueMetadata, error) { serializer.go
570 > result := &persistencespb.QueueMetadata{}
571 > return result, Decode(data, result)
572 > }
573
574 func (t *serializerImpl) ReplicationTaskToBlob(replicationTask *replicationspb.ReplicationTask) (*commonpb.DataBlob, error) {