github.com/cockroachdb/pebble@v0.0.0-20231214172447-ab4952c5f87b/objstorage/objstorageprovider/testdata/provider/shared_attach (about)

     1  # Basic tests for obtaining the backing of shared objects and attaching them to
     2  # another provider.
     3  
     4  open p1 1
     5  ----
     6  <local fs> mkdir-all: p1 0755
     7  <local fs> open-dir: p1
     8  <local fs> open-dir: p1
     9  <local fs> create: p1/REMOTE-OBJ-CATALOG-000001
    10  <local fs> sync: p1/REMOTE-OBJ-CATALOG-000001
    11  <local fs> create: p1/marker.remote-obj-catalog.000001.REMOTE-OBJ-CATALOG-000001
    12  <local fs> close: p1/marker.remote-obj-catalog.000001.REMOTE-OBJ-CATALOG-000001
    13  <local fs> sync: p1
    14  <local fs> sync: p1/REMOTE-OBJ-CATALOG-000001
    15  
    16  create 1 shared 1 100
    17  ----
    18  <remote> create object "61a6-1-000001.sst"
    19  <remote> close writer for "61a6-1-000001.sst" after 100 bytes
    20  <remote> create object "61a6-1-000001.sst.ref.1.000001"
    21  <remote> close writer for "61a6-1-000001.sst.ref.1.000001" after 0 bytes
    22  
    23  create 2 shared 2 200
    24  ----
    25  <remote> create object "a629-1-000002.sst"
    26  <remote> close writer for "a629-1-000002.sst" after 200 bytes
    27  <remote> create object "a629-1-000002.sst.ref.1.000002"
    28  <remote> close writer for "a629-1-000002.sst.ref.1.000002" after 0 bytes
    29  
    30  create 3 shared 3 300
    31  ----
    32  <remote> create object "eaac-1-000003.sst"
    33  <remote> close writer for "eaac-1-000003.sst" after 300 bytes
    34  <remote> create object "eaac-1-000003.sst.ref.1.000003"
    35  <remote> close writer for "eaac-1-000003.sst.ref.1.000003" after 0 bytes
    36  
    37  create 100 local 100 15
    38  ----
    39  <local fs> create: p1/000100.sst
    40  <local fs> sync-data: p1/000100.sst
    41  <local fs> close: p1/000100.sst
    42  
    43  list
    44  ----
    45  000001 -> remote://61a6-1-000001.sst
    46  000002 -> remote://a629-1-000002.sst
    47  000003 -> remote://eaac-1-000003.sst
    48  000100 -> p1/000100.sst
    49  
    50  # Can't get backing of local object.
    51  save-backing foo 100
    52  ----
    53  object 000100 not on remote storage
    54  
    55  save-backing b1 1
    56  ----
    57  
    58  save-backing b2 2
    59  ----
    60  
    61  save-backing b3 3
    62  ----
    63  
    64  close
    65  ----
    66  <local fs> sync: p1
    67  <local fs> sync: p1/REMOTE-OBJ-CATALOG-000001
    68  <local fs> close: p1/REMOTE-OBJ-CATALOG-000001
    69  <local fs> close: p1
    70  
    71  open p2 2
    72  ----
    73  <local fs> mkdir-all: p2 0755
    74  <local fs> open-dir: p2
    75  <local fs> open-dir: p2
    76  <local fs> create: p2/REMOTE-OBJ-CATALOG-000001
    77  <local fs> sync: p2/REMOTE-OBJ-CATALOG-000001
    78  <local fs> create: p2/marker.remote-obj-catalog.000001.REMOTE-OBJ-CATALOG-000001
    79  <local fs> close: p2/marker.remote-obj-catalog.000001.REMOTE-OBJ-CATALOG-000001
    80  <local fs> sync: p2
    81  <local fs> sync: p2/REMOTE-OBJ-CATALOG-000001
    82  
    83  create 100 shared 100 15
    84  ----
    85  <remote> create object "fd72-2-000100.sst"
    86  <remote> close writer for "fd72-2-000100.sst" after 15 bytes
    87  <remote> create object "fd72-2-000100.sst.ref.2.000100"
    88  <remote> close writer for "fd72-2-000100.sst.ref.2.000100" after 0 bytes
    89  
    90  attach
    91  b1 101
    92  b2 102
    93  b3 103
    94  ----
    95  <remote> create object "61a6-1-000001.sst.ref.2.000101"
    96  <remote> close writer for "61a6-1-000001.sst.ref.2.000101" after 0 bytes
    97  <remote> size of object "61a6-1-000001.sst.ref.1.000001": 0
    98  <remote> create object "a629-1-000002.sst.ref.2.000102"
    99  <remote> close writer for "a629-1-000002.sst.ref.2.000102" after 0 bytes
   100  <remote> size of object "a629-1-000002.sst.ref.1.000002": 0
   101  <remote> create object "eaac-1-000003.sst.ref.2.000103"
   102  <remote> close writer for "eaac-1-000003.sst.ref.2.000103" after 0 bytes
   103  <remote> size of object "eaac-1-000003.sst.ref.1.000003": 0
   104  <local fs> sync: p2/REMOTE-OBJ-CATALOG-000001
   105  000101 -> remote://61a6-1-000001.sst
   106  000102 -> remote://a629-1-000002.sst
   107  000103 -> remote://eaac-1-000003.sst
   108  
   109  list
   110  ----
   111  000100 -> remote://fd72-2-000100.sst
   112  000101 -> remote://61a6-1-000001.sst
   113  000102 -> remote://a629-1-000002.sst
   114  000103 -> remote://eaac-1-000003.sst
   115  
   116  read 101
   117  0 100
   118  15 10
   119  ----
   120  <remote> size of object "61a6-1-000001.sst.ref.2.000101": 0
   121  <remote> create reader for object "61a6-1-000001.sst": 100 bytes
   122  size: 100
   123  <remote> read object "61a6-1-000001.sst" at 0 (length 100)
   124  0 100: ok (salt 1)
   125  <remote> read object "61a6-1-000001.sst" at 15 (length 10)
   126  15 10: ok (salt 1)
   127  <remote> close reader for "61a6-1-000001.sst"
   128  
   129  read 102
   130  0 200
   131  90 100
   132  ----
   133  <remote> size of object "a629-1-000002.sst.ref.2.000102": 0
   134  <remote> create reader for object "a629-1-000002.sst": 200 bytes
   135  size: 200
   136  <remote> read object "a629-1-000002.sst" at 0 (length 200)
   137  0 200: ok (salt 2)
   138  <remote> read object "a629-1-000002.sst" at 90 (length 100)
   139  90 100: ok (salt 2)
   140  <remote> close reader for "a629-1-000002.sst"
   141  
   142  read 103
   143  0 300
   144  ----
   145  <remote> size of object "eaac-1-000003.sst.ref.2.000103": 0
   146  <remote> create reader for object "eaac-1-000003.sst": 300 bytes
   147  size: 300
   148  <remote> read object "eaac-1-000003.sst" at 0 (length 300)
   149  0 300: ok (salt 3)
   150  <remote> close reader for "eaac-1-000003.sst"