github.com/cockroachdb/pebble@v1.1.2/objstorage/objstorageprovider/testdata/provider/shared_remove (about)

     1  open p1 1
     2  ----
     3  <local fs> mkdir-all: p1 0755
     4  <local fs> open-dir: p1
     5  <local fs> open-dir: p1
     6  <local fs> create: p1/REMOTE-OBJ-CATALOG-000001
     7  <local fs> sync: p1/REMOTE-OBJ-CATALOG-000001
     8  <local fs> create: p1/marker.remote-obj-catalog.000001.REMOTE-OBJ-CATALOG-000001
     9  <local fs> close: p1/marker.remote-obj-catalog.000001.REMOTE-OBJ-CATALOG-000001
    10  <local fs> sync: p1
    11  <local fs> sync: p1/REMOTE-OBJ-CATALOG-000001
    12  
    13  create 1 shared 1 100
    14  ----
    15  <remote> create object "61a6-1-000001.sst"
    16  <remote> close writer for "61a6-1-000001.sst" after 100 bytes
    17  <remote> create object "61a6-1-000001.sst.ref.1.000001"
    18  <remote> close writer for "61a6-1-000001.sst.ref.1.000001" after 0 bytes
    19  
    20  create 2 shared 2 100
    21  ----
    22  <remote> create object "a629-1-000002.sst"
    23  <remote> close writer for "a629-1-000002.sst" after 100 bytes
    24  <remote> create object "a629-1-000002.sst.ref.1.000002"
    25  <remote> close writer for "a629-1-000002.sst.ref.1.000002" after 0 bytes
    26  
    27  create 3 shared 3 100
    28  ----
    29  <remote> create object "eaac-1-000003.sst"
    30  <remote> close writer for "eaac-1-000003.sst" after 100 bytes
    31  <remote> create object "eaac-1-000003.sst.ref.1.000003"
    32  <remote> close writer for "eaac-1-000003.sst.ref.1.000003" after 0 bytes
    33  
    34  save-backing b1 1
    35  ----
    36  
    37  save-backing b2 2
    38  ----
    39  
    40  open p2 2
    41  ----
    42  <local fs> mkdir-all: p2 0755
    43  <local fs> open-dir: p2
    44  <local fs> open-dir: p2
    45  <local fs> create: p2/REMOTE-OBJ-CATALOG-000001
    46  <local fs> sync: p2/REMOTE-OBJ-CATALOG-000001
    47  <local fs> create: p2/marker.remote-obj-catalog.000001.REMOTE-OBJ-CATALOG-000001
    48  <local fs> close: p2/marker.remote-obj-catalog.000001.REMOTE-OBJ-CATALOG-000001
    49  <local fs> sync: p2
    50  <local fs> sync: p2/REMOTE-OBJ-CATALOG-000001
    51  
    52  create 4 shared 4 100
    53  ----
    54  <remote> create object "4c52-2-000004.sst"
    55  <remote> close writer for "4c52-2-000004.sst" after 100 bytes
    56  <remote> create object "4c52-2-000004.sst.ref.2.000004"
    57  <remote> close writer for "4c52-2-000004.sst.ref.2.000004" after 0 bytes
    58  
    59  attach
    60  b1 101
    61  b2 102
    62  ----
    63  <remote> create object "61a6-1-000001.sst.ref.2.000101"
    64  <remote> close writer for "61a6-1-000001.sst.ref.2.000101" after 0 bytes
    65  <remote> size of object "61a6-1-000001.sst.ref.1.000001": 0
    66  <remote> create object "a629-1-000002.sst.ref.2.000102"
    67  <remote> close writer for "a629-1-000002.sst.ref.2.000102" after 0 bytes
    68  <remote> size of object "a629-1-000002.sst.ref.1.000002": 0
    69  <local fs> sync: p2/REMOTE-OBJ-CATALOG-000001
    70  000101 -> remote://61a6-1-000001.sst
    71  000102 -> remote://a629-1-000002.sst
    72  
    73  # Remove of object with no other refs; backing object should be removed.
    74  remove 4
    75  ----
    76  <remote> delete object "4c52-2-000004.sst.ref.2.000004"
    77  <remote> list (prefix="4c52-2-000004.sst.ref.", delimiter="")
    78  <remote> delete object "4c52-2-000004.sst"
    79  
    80  # Object shared with p2; backing object should not be removed.
    81  remove 101
    82  ----
    83  <remote> delete object "61a6-1-000001.sst.ref.2.000101"
    84  <remote> list (prefix="61a6-1-000001.sst.ref.", delimiter="")
    85  <remote>  - 61a6-1-000001.sst.ref.1.000001
    86  
    87  switch p1
    88  ----
    89  
    90  # Object no longer shared with p1; backing object should be removed.
    91  remove 1
    92  ----
    93  
    94  # Object shared with p1; backing object should not be removed.
    95  remove 2
    96  ----
    97  
    98  switch p2
    99  ----
   100  
   101  remove 102
   102  ----
   103  <remote> delete object "a629-1-000002.sst.ref.2.000102"
   104  <remote> list (prefix="a629-1-000002.sst.ref.", delimiter="")
   105  <remote>  - a629-1-000002.sst.ref.1.000002