queue_v2.go ×2

Frontier kind: Code frontier

unlabeled · c_2983cab78e48

5 tests · 3269 LOC · 158 files · introduces 0 tests · 35 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
3 ranges35 lines · 2 files
Tests
0 tests

Contains — complete concept membership

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

go.temporal.io/server/common/persistence/sql/sqlplugin/tests/queue_v2.go 33 introduced LOC · 2 ranges

Open complete file

189 })
190 t.Run("GetPartitionFailsForListQueues", func(t *testing.T) {
191 > t.Parallel() queue_v2.go
192 > testListQueuesGetPartitionFails(ctx, t, baseDB)
193 > })
194 t.Run("QueueInsertFails", func(t *testing.T) {
195 t.Parallel()
640 }
641
642 > func testListQueuesGetPartitionFails(ctx context.Context, t *testing.T, baseDB sqlplugin.DB) { queue_v2.go
643 > // Using a different QueueType to prevent this test from failing because of queues created in previous tests.
644 > queueType := persistence.QueueV2Type(4)
645 > queueName := "test-queue-" + t.Name()
646 > logger := &logRecorder{Logger: log.NewTestLogger()}
647 > q := persistencesql.NewQueueV2(baseDB, logger, serialization.NewSerializer())
648 > queuePB := persistencespb.Queue{
649 > Partitions: map[int32]*persistencespb.QueuePartition{
650 > 0: {},
651 > 1: {},
652 > },
653 > }
654 > bytes, _ := queuePB.Marshal()
655 > row := sqlplugin.QueueV2MetadataRow{
656 > QueueType: queueType,
657 > QueueName: queueName,
658 > MetadataPayload: bytes,
659 > MetadataEncoding: enumspb.ENCODING_TYPE_PROTO3.String(),
660 > }
661 > _, err := baseDB.InsertIntoQueueV2Metadata(ctx, &row)
662 > require.NoError(t, err)
663 > _, err = persistencetest.EnqueueMessage(context.Background(), q, queueType, queueName)
664 > require.NoError(t, err)
665 > _, err = q.ListQueues(context.Background(), &persistence.InternalListQueuesRequest{
666 > QueueType: queueType,
667 > PageSize: 100,
668 > })
669 > assert.Error(t, err)
670 > assert.ErrorContains(t, err, "partitions")
671 > }
672
673 func testListQueueFailsToGetLastMessageID(ctx context.Context, t *testing.T, baseDB sqlplugin.DB) {
go.temporal.io/server/common/persistence/sql/queue_v2.go 2 introduced LOC · 1 range

Open complete file

460 partition, err := persistence.GetPartitionForQueueV2(row.QueueType, row.QueueName, qm)
461 if err != nil {
462 > return 0, 0, err queue_v2.go
463 > }
464 messageCount = lastMessageID - partition.MinMessageId + 1
465 return messageCount, lastMessageID, nil