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

     1  # Tests with shared storage when ref tracking is disabled.
     2  
     3  # open <fs-dir> <creator-id>
     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 no-ref-tracking
    17  ----
    18  <remote> create object "61a6-1-000001.sst"
    19  <remote> close writer for "61a6-1-000001.sst" after 100 bytes
    20  
    21  read 1
    22  0 100
    23  ----
    24  <remote> create reader for object "61a6-1-000001.sst": 100 bytes
    25  size: 100
    26  <remote> read object "61a6-1-000001.sst" at 0 (length 100)
    27  0 100: ok (salt 1)
    28  <remote> close reader for "61a6-1-000001.sst"
    29  
    30  create 2 shared 2 100 no-ref-tracking
    31  ----
    32  <remote> create object "a629-1-000002.sst"
    33  <remote> close writer for "a629-1-000002.sst" after 100 bytes
    34  
    35  read 2
    36  0 100
    37  ----
    38  <remote> create reader for object "a629-1-000002.sst": 100 bytes
    39  size: 100
    40  <remote> read object "a629-1-000002.sst" at 0 (length 100)
    41  0 100: ok (salt 2)
    42  <remote> close reader for "a629-1-000002.sst"
    43  
    44  list
    45  ----
    46  000001 -> remote://61a6-1-000001.sst
    47  000002 -> remote://a629-1-000002.sst
    48  
    49  link-or-copy 3 shared 3 100 no-ref-tracking
    50  ----
    51  <local fs> create: temp-file-1
    52  <local fs> close: temp-file-1
    53  <remote> create object "eaac-1-000003.sst"
    54  <local fs> open: temp-file-1
    55  <remote> close writer for "eaac-1-000003.sst" after 100 bytes
    56  <local fs> close: temp-file-1
    57  
    58  read 3
    59  0 100
    60  ----
    61  <remote> create reader for object "eaac-1-000003.sst": 100 bytes
    62  size: 100
    63  <remote> read object "eaac-1-000003.sst" at 0 (length 100)
    64  0 100: ok (salt 3)
    65  <remote> close reader for "eaac-1-000003.sst"
    66  
    67  close
    68  ----
    69  <local fs> sync: p1/REMOTE-OBJ-CATALOG-000001
    70  <local fs> close: p1/REMOTE-OBJ-CATALOG-000001
    71  <local fs> close: p1
    72  
    73  # Test that the objects are there on re-open.
    74  open p1 1
    75  ----
    76  <local fs> mkdir-all: p1 0755
    77  <local fs> open-dir: p1
    78  <local fs> open-dir: p1
    79  <local fs> open: p1/REMOTE-OBJ-CATALOG-000001
    80  <local fs> close: p1/REMOTE-OBJ-CATALOG-000001
    81  
    82  list
    83  ----
    84  000001 -> remote://61a6-1-000001.sst
    85  000002 -> remote://a629-1-000002.sst
    86  000003 -> remote://eaac-1-000003.sst
    87  
    88  read 1
    89  0 100
    90  ----
    91  <remote> create reader for object "61a6-1-000001.sst": 100 bytes
    92  size: 100
    93  <remote> read object "61a6-1-000001.sst" at 0 (length 100)
    94  0 100: ok (salt 1)
    95  <remote> close reader for "61a6-1-000001.sst"
    96  
    97  read 2
    98  0 100
    99  ----
   100  <remote> create reader for object "a629-1-000002.sst": 100 bytes
   101  size: 100
   102  <remote> read object "a629-1-000002.sst" at 0 (length 100)
   103  0 100: ok (salt 2)
   104  <remote> close reader for "a629-1-000002.sst"
   105  
   106  read 3
   107  0 100
   108  ----
   109  <remote> create reader for object "eaac-1-000003.sst": 100 bytes
   110  size: 100
   111  <remote> read object "eaac-1-000003.sst" at 0 (length 100)
   112  0 100: ok (salt 3)
   113  <remote> close reader for "eaac-1-000003.sst"
   114  
   115  save-backing b1 1
   116  ----
   117  
   118  save-backing b2 1
   119  ----
   120  
   121  open p2 2
   122  ----
   123  <local fs> mkdir-all: p2 0755
   124  <local fs> open-dir: p2
   125  <local fs> open-dir: p2
   126  <local fs> create: p2/REMOTE-OBJ-CATALOG-000001
   127  <local fs> sync: p2/REMOTE-OBJ-CATALOG-000001
   128  <local fs> create: p2/marker.remote-obj-catalog.000001.REMOTE-OBJ-CATALOG-000001
   129  <local fs> close: p2/marker.remote-obj-catalog.000001.REMOTE-OBJ-CATALOG-000001
   130  <local fs> sync: p2
   131  <local fs> sync: p2/REMOTE-OBJ-CATALOG-000001
   132  
   133  attach
   134  b1 101
   135  b2 102
   136  ----
   137  <local fs> sync: p2/REMOTE-OBJ-CATALOG-000001
   138  000101 -> remote://61a6-1-000001.sst
   139  000102 -> remote://61a6-1-000001.sst
   140  
   141  list
   142  ----
   143  000101 -> remote://61a6-1-000001.sst
   144  000102 -> remote://61a6-1-000001.sst
   145  
   146  read 101
   147  0 100
   148  ----
   149  <remote> create reader for object "61a6-1-000001.sst": 100 bytes
   150  size: 100
   151  <remote> read object "61a6-1-000001.sst" at 0 (length 100)
   152  0 100: ok (salt 1)
   153  <remote> close reader for "61a6-1-000001.sst"
   154  
   155  read 102
   156  0 100
   157  ----
   158  <remote> create reader for object "61a6-1-000001.sst": 100 bytes
   159  size: 100
   160  <remote> read object "61a6-1-000001.sst" at 0 (length 100)
   161  0 100: ok (salt 1)
   162  <remote> close reader for "61a6-1-000001.sst"
   163  
   164  # In this mode, all removes should be no-ops on the shared backend.
   165  remove 101
   166  ----
   167  
   168  remove 102
   169  ----
   170  
   171  switch p1
   172  ----
   173  
   174  remove 1
   175  ----
   176  
   177  remove 2
   178  ----