history_store.go ×1

Frontier kind: Code frontier

unlabeled · c_eb723887652f

7 tests · 3653 LOC · 158 files · introduces 0 tests · 67 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
1 range67 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
584 ranges3653 lines · 158 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.

1 file ranked by introduced lines: 67 introduced LOC across 1 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/common/persistence/tests/history_store.go 67 introduced LOC · 1 range

Open complete file

593 }
594
595 > func (s *HistoryEventsSuite) TestForkDeleteBranch_DeleteBaseBranchFirst() { history_store.go
596 > treeID := uuid.NewString()
597 > branchID := uuid.NewString()
598 > br1Token, err := s.store.GetHistoryBranchUtil().NewHistoryBranch(
599 > uuid.NewString(),
600 > uuid.NewString(),
601 > uuid.NewString(),
602 > treeID,
603 > &branchID,
604 > []*persistencespb.HistoryBranchRange{},
605 > time.Duration(0),
606 > time.Duration(0),
607 > time.Duration(0),
608 > )
609 > s.NoError(err)
610 >
611 > eventsPacket0 := s.newHistoryEvents(
612 > []int64{1, 2, 3},
613 > rand.Int63(),
614 > 0,
615 > )
616 > s.appendHistoryEvents(s.ShardID, br1Token, eventsPacket0)
617 >
618 > s.appendHistoryEvents(s.ShardID, br1Token, s.newHistoryEvents(
619 > []int64{4, 5},
620 > eventsPacket0.transactionID+1,
621 > eventsPacket0.transactionID,
622 > ))
623 >
624 > br2Token := s.forkHistoryBranch(s.ShardID, br1Token, 4)
625 > eventsPacket1 := s.newHistoryEvents(
626 > []int64{4, 5},
627 > eventsPacket0.transactionID+2,
628 > eventsPacket0.transactionID,
629 > )
630 > s.appendHistoryEvents(s.ShardID, br2Token, eventsPacket1)
631 >
632 > // delete branch1, should only delete branch1:[4,5], keep branch1:[1,2,3] as it is used as ancestor by branch2
633 > s.deleteHistoryBranch(s.ShardID, br1Token)
634 > // verify branch1:[1,2,3] still remains
635 > protorequire.ProtoSliceEqual(s.T(), eventsPacket0.events, s.listAllHistoryEvents(s.ShardID, br1Token))
636 > // verify branch2 is not affected
637 > protorequire.ProtoSliceEqual(s.T(), append(eventsPacket0.events, eventsPacket1.events...), s.listAllHistoryEvents(s.ShardID, br2Token))
638 >
639 > // delete branch2, should delete branch2:[4,5], and also should delete ancestor branch1:[1,2,3] as it is no longer
640 > // used by anyone
641 > s.deleteHistoryBranch(s.ShardID, br2Token)
642 >
643 > // at this point, both branch1 and branch2 are deleted.
644 > _, err = s.store.ReadHistoryBranch(s.Ctx, &p.ReadHistoryBranchRequest{
645 > ShardID: s.ShardID,
646 > BranchToken: br1Token,
647 > MinEventID: common.FirstEventID,
648 > MaxEventID: common.LastEventID,
649 > PageSize: 1,
650 > })
651 > s.Error(err, "Workflow execution history not found.")
652 >
653 > _, err = s.store.ReadHistoryBranch(s.Ctx, &p.ReadHistoryBranchRequest{
654 > ShardID: s.ShardID,
655 > BranchToken: br2Token,
656 > MinEventID: common.FirstEventID,
657 > MaxEventID: common.LastEventID,
658 > PageSize: 1,
659 > })
660 > s.Error(err, "Workflow execution history not found.")
661 > }
662
663 func (s *HistoryEventsSuite) TestForkDeleteBranch_DeleteForkedBranchFirst() {