github.com/cockroachdb/pebble@v1.1.1-0.20240513155919-3622ade60459/objstorage/objstorageprovider/testdata/provider/shared_attach_multi (about)

     1  # Tests with the same shared object attached as multiple objects.
     2  
     3  open p1 1
     4  ----
     5  <local fs> mkdir-all: p1 0755
     6  <local fs> open-dir: p1
     7  <local fs> open-dir: p1
     8  <local fs> create: p1/REMOTE-OBJ-CATALOG-000001
     9  <local fs> sync: p1/REMOTE-OBJ-CATALOG-000001
    10  <local fs> create: p1/marker.remote-obj-catalog.000001.REMOTE-OBJ-CATALOG-000001
    11  <local fs> close: p1/marker.remote-obj-catalog.000001.REMOTE-OBJ-CATALOG-000001
    12  <local fs> sync: p1
    13  <local fs> sync: p1/REMOTE-OBJ-CATALOG-000001
    14  
    15  create 1 shared 1 100
    16  ----
    17  <remote> create object "61a6-1-000001.sst"
    18  <remote> close writer for "61a6-1-000001.sst" after 100 bytes
    19  <remote> create object "61a6-1-000001.sst.ref.1.000001"
    20  <remote> close writer for "61a6-1-000001.sst.ref.1.000001" after 0 bytes
    21  
    22  save-backing b1 1
    23  ----
    24  
    25  open p2 2
    26  ----
    27  <local fs> mkdir-all: p2 0755
    28  <local fs> open-dir: p2
    29  <local fs> open-dir: p2
    30  <local fs> create: p2/REMOTE-OBJ-CATALOG-000001
    31  <local fs> sync: p2/REMOTE-OBJ-CATALOG-000001
    32  <local fs> create: p2/marker.remote-obj-catalog.000001.REMOTE-OBJ-CATALOG-000001
    33  <local fs> close: p2/marker.remote-obj-catalog.000001.REMOTE-OBJ-CATALOG-000001
    34  <local fs> sync: p2
    35  <local fs> sync: p2/REMOTE-OBJ-CATALOG-000001
    36  
    37  # We should create three ref markers to allow independent removal.
    38  attach
    39  b1 101
    40  b1 102
    41  b1 103
    42  ----
    43  <remote> create object "61a6-1-000001.sst.ref.2.000101"
    44  <remote> close writer for "61a6-1-000001.sst.ref.2.000101" after 0 bytes
    45  <remote> size of object "61a6-1-000001.sst.ref.1.000001": 0
    46  <remote> create object "61a6-1-000001.sst.ref.2.000102"
    47  <remote> close writer for "61a6-1-000001.sst.ref.2.000102" after 0 bytes
    48  <remote> size of object "61a6-1-000001.sst.ref.1.000001": 0
    49  <remote> create object "61a6-1-000001.sst.ref.2.000103"
    50  <remote> close writer for "61a6-1-000001.sst.ref.2.000103" after 0 bytes
    51  <remote> size of object "61a6-1-000001.sst.ref.1.000001": 0
    52  <local fs> sync: p2/REMOTE-OBJ-CATALOG-000001
    53  000101 -> remote://61a6-1-000001.sst
    54  000102 -> remote://61a6-1-000001.sst
    55  000103 -> remote://61a6-1-000001.sst
    56  
    57  close-backing b1
    58  ----
    59  
    60  # Remove original object.
    61  switch p1
    62  ----
    63  
    64  remove 1
    65  ----
    66  <remote> delete object "61a6-1-000001.sst.ref.1.000001"
    67  <remote> list (prefix="61a6-1-000001.sst.ref.", delimiter="")
    68  <remote>  - 61a6-1-000001.sst.ref.2.000101
    69  <remote>  - 61a6-1-000001.sst.ref.2.000102
    70  <remote>  - 61a6-1-000001.sst.ref.2.000103
    71  
    72  switch p2
    73  ----
    74  
    75  remove 101
    76  ----
    77  <remote> delete object "61a6-1-000001.sst.ref.2.000101"
    78  <remote> list (prefix="61a6-1-000001.sst.ref.", delimiter="")
    79  <remote>  - 61a6-1-000001.sst.ref.2.000102
    80  <remote>  - 61a6-1-000001.sst.ref.2.000103
    81  
    82  remove 103
    83  ----
    84  <remote> delete object "61a6-1-000001.sst.ref.2.000103"
    85  <remote> list (prefix="61a6-1-000001.sst.ref.", delimiter="")
    86  <remote>  - 61a6-1-000001.sst.ref.2.000102
    87  
    88  remove 102
    89  ----
    90  <remote> delete object "61a6-1-000001.sst.ref.2.000102"
    91  <remote> list (prefix="61a6-1-000001.sst.ref.", delimiter="")
    92  <remote> delete object "61a6-1-000001.sst"