@@ -570,3 +570,116 @@ no zombie tables
570
570
no obsolete tables
571
571
no zombie blob files
572
572
no obsolete blob files
573
+
574
+ # Test a blob file replacement.
575
+
576
+ apply
577
+ add-blob-file: B000016 physical:{000016 size:[10000 (9.8KB)] vals:[10000 (9.8KB)]}
578
+ add-table: L4 000017:[f#20,SET-g#20,SET] blobrefs:[(B000016: 10000); depth:1]
579
+ ----
580
+ applied:
581
+ last-seq-num: 99
582
+ add-table: L4 000017:[f#20,SET-g#20,SET]
583
+ add-blob-file: B000016 physical:{000016 size:[10000 (9.8KB)] vals:[10000 (9.8KB)]}
584
+ current version:
585
+ L2:
586
+ 000001:[a#1,SET-c#1,SET] seqnums:[0-0] points:[a#1,SET-c#1,SET] size:100
587
+ L3:
588
+ 000008:[a#1,SET-c#1,SET] seqnums:[0-0] points:[a#1,SET-c#1,SET] size:800
589
+ 000010:[d#1,SET-e#1,SET] seqnums:[0-0] points:[d#1,SET-e#1,SET] size:1000
590
+ L4:
591
+ 000017:[f#20,SET-g#20,SET] seqnums:[0-0] points:[f#20,SET-g#20,SET] size:1700 blobrefs:[(B000016: 10000); depth:1]
592
+ Blob files:
593
+ B000016 physical:{000016 size:[10000 (9.8KB)] vals:[10000 (9.8KB)]}
594
+ no virtual backings
595
+ no zombie tables
596
+ no obsolete tables
597
+ no zombie blob files
598
+ no obsolete blob files
599
+
600
+ ref-version r3
601
+ ----
602
+ current version:
603
+ L2:
604
+ 000001:[a#1,SET-c#1,SET] seqnums:[0-0] points:[a#1,SET-c#1,SET] size:100
605
+ L3:
606
+ 000008:[a#1,SET-c#1,SET] seqnums:[0-0] points:[a#1,SET-c#1,SET] size:800
607
+ 000010:[d#1,SET-e#1,SET] seqnums:[0-0] points:[d#1,SET-e#1,SET] size:1000
608
+ L4:
609
+ 000017:[f#20,SET-g#20,SET] seqnums:[0-0] points:[f#20,SET-g#20,SET] size:1700 blobrefs:[(B000016: 10000); depth:1]
610
+ Blob files:
611
+ B000016 physical:{000016 size:[10000 (9.8KB)] vals:[10000 (9.8KB)]}
612
+ no virtual backings
613
+ no zombie tables
614
+ no obsolete tables
615
+ no zombie blob files
616
+ no obsolete blob files
617
+
618
+ # Apply the blob file replacement. Because we ref'd the previous version, the
619
+ # previous physical blob file should be considered a zombie.
620
+
621
+ apply
622
+ del-blob-file: B000016 000016
623
+ add-blob-file: B000016 physical:{000018 size:[5000 (4.9KB)] vals:[5000 (4.9KB)]}
624
+ ----
625
+ applied:
626
+ last-seq-num: 99
627
+ add-blob-file: B000016 physical:{000018 size:[5000 (4.9KB)] vals:[5000 (4.9KB)]}
628
+ del-blob-file: B000016 000016
629
+ current version:
630
+ L2:
631
+ 000001:[a#1,SET-c#1,SET] seqnums:[0-0] points:[a#1,SET-c#1,SET] size:100
632
+ L3:
633
+ 000008:[a#1,SET-c#1,SET] seqnums:[0-0] points:[a#1,SET-c#1,SET] size:800
634
+ 000010:[d#1,SET-e#1,SET] seqnums:[0-0] points:[d#1,SET-e#1,SET] size:1000
635
+ L4:
636
+ 000017:[f#20,SET-g#20,SET] seqnums:[0-0] points:[f#20,SET-g#20,SET] size:1700 blobrefs:[(B000016: 10000); depth:1]
637
+ Blob files:
638
+ B000016 physical:{000018 size:[5000 (4.9KB)] vals:[5000 (4.9KB)]}
639
+ no virtual backings
640
+ no zombie tables
641
+ no obsolete tables
642
+ zombie blob files: 000016
643
+ no obsolete blob files
644
+
645
+ # Once we unref the version, the old 000016 physical blob file should become
646
+ # obsolete. The new physical blob file 000018 remains under the 000016
647
+ # BlobFileID.
648
+
649
+ unref-version r3
650
+ ----
651
+ current version:
652
+ L2:
653
+ 000001:[a#1,SET-c#1,SET] seqnums:[0-0] points:[a#1,SET-c#1,SET] size:100
654
+ L3:
655
+ 000008:[a#1,SET-c#1,SET] seqnums:[0-0] points:[a#1,SET-c#1,SET] size:800
656
+ 000010:[d#1,SET-e#1,SET] seqnums:[0-0] points:[d#1,SET-e#1,SET] size:1000
657
+ L4:
658
+ 000017:[f#20,SET-g#20,SET] seqnums:[0-0] points:[f#20,SET-g#20,SET] size:1700 blobrefs:[(B000016: 10000); depth:1]
659
+ Blob files:
660
+ B000016 physical:{000018 size:[5000 (4.9KB)] vals:[5000 (4.9KB)]}
661
+ no virtual backings
662
+ no zombie tables
663
+ no obsolete tables
664
+ no zombie blob files
665
+ obsolete blob files: 000016
666
+
667
+ # Reopening should recover the previous state.
668
+
669
+ reopen
670
+ ----
671
+ current version:
672
+ L2:
673
+ 000001:[a#1,SET-c#1,SET] seqnums:[0-0] points:[a#1,SET-c#1,SET] size:100
674
+ L3:
675
+ 000008:[a#1,SET-c#1,SET] seqnums:[0-0] points:[a#1,SET-c#1,SET] size:800
676
+ 000010:[d#1,SET-e#1,SET] seqnums:[0-0] points:[d#1,SET-e#1,SET] size:1000
677
+ L4:
678
+ 000017:[f#20,SET-g#20,SET] seqnums:[0-0] points:[f#20,SET-g#20,SET] size:1700 blobrefs:[(B000016: 10000); depth:1]
679
+ Blob files:
680
+ B000016 physical:{000018 size:[5000 (4.9KB)] vals:[5000 (4.9KB)]}
681
+ no virtual backings
682
+ no zombie tables
683
+ no obsolete tables
684
+ no zombie blob files
685
+ no obsolete blob files
0 commit comments