Skip to content

Commit

Permalink
vfs: add Open options to loggingFS
Browse files Browse the repository at this point in the history
Log the options passed to `Open`.
  • Loading branch information
RaduBerinde committed Jun 11, 2024
1 parent 4273469 commit 6b251de
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 57 deletions.
8 changes: 4 additions & 4 deletions objstorage/objstorageprovider/testdata/provider/local
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ read 1
0 1024
512 1024
----
<local fs> open: p0/000001.sst
<local fs> open: p0/000001.sst (options: *vfs.randomReadsOption)
size: 1024
<local fs> read-at(0, 512): p0/000001.sst
0 512: ok (salt 1)
Expand All @@ -41,7 +41,7 @@ read 2
0 1024
512 1024
----
<local fs> open: p0/000002.sst
<local fs> open: p0/000002.sst (options: *vfs.randomReadsOption)
size: 1024
<local fs> read-at(0, 512): p0/000002.sst
0 512: ok (salt 2)
Expand Down Expand Up @@ -73,7 +73,7 @@ link-or-copy 3 local 3 100
read 3
0 100
----
<local fs> open: p0/000003.sst
<local fs> open: p0/000003.sst (options: *vfs.randomReadsOption)
size: 100
<local fs> read-at(0, 100): p0/000003.sst
0 100: ok (salt 3)
Expand All @@ -88,7 +88,7 @@ link-or-copy 4 shared 4 1234
read 4
0 1234
----
<local fs> open: p0/000004.sst
<local fs> open: p0/000004.sst (options: *vfs.randomReadsOption)
size: 1234
<local fs> read-at(0, 1234): p0/000004.sst
0 1234: ok (salt 4)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ read 1
106000 30000
140000 80000
----
<local fs> open: p1/000001.sst
<local fs> open: p1/000001.sst (options: *vfs.randomReadsOption)
size: 2000000
<local fs> read-at(0, 1000): p1/000001.sst
0 1000: ok (salt 1)
Expand All @@ -44,7 +44,7 @@ size: 2000000
56000 50000: ok (salt 1)
<local fs> read-at(106000, 30000): p1/000001.sst
106000 30000: ok (salt 1)
<local fs> open: p1/000001.sst
<local fs> open: p1/000001.sst (options: *vfs.sequentialReadsOption)
<local fs> read-at(140000, 80000): p1/000001.sst
140000 80000: ok (salt 1)
<local fs> close: p1/000001.sst
Expand Down
6 changes: 3 additions & 3 deletions objstorage/objstorageprovider/testdata/provider/shared_basic
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ create 1 local 1 100
read 1
0 100
----
<local fs> open: p1/000001.sst
<local fs> open: p1/000001.sst (options: *vfs.randomReadsOption)
size: 100
<local fs> read-at(0, 100): p1/000001.sst
0 100: ok (salt 1)
Expand Down Expand Up @@ -90,7 +90,7 @@ link-or-copy 3 local 3 100
read 3
0 100
----
<local fs> open: p1/000003.sst
<local fs> open: p1/000003.sst (options: *vfs.randomReadsOption)
size: 100
<local fs> read-at(0, 100): p1/000003.sst
0 100: ok (salt 3)
Expand All @@ -101,7 +101,7 @@ link-or-copy 4 shared 4 100
<local fs> create: temp-file-2
<local fs> close: temp-file-2
<remote> create object "2f2f-1-000004.sst"
<local fs> open: temp-file-2
<local fs> open: temp-file-2 (options: *vfs.sequentialReadsOption)
<remote> close writer for "2f2f-1-000004.sst" after 100 bytes
<remote> create object "2f2f-1-000004.sst.ref.1.000004"
<remote> close writer for "2f2f-1-000004.sst.ref.1.000004" after 0 bytes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ link-or-copy 3 shared 3 100 no-ref-tracking
<local fs> create: temp-file-1
<local fs> close: temp-file-1
<remote> create object "eaac-1-000003.sst"
<local fs> open: temp-file-1
<local fs> open: temp-file-1 (options: *vfs.sequentialReadsOption)
<remote> close writer for "eaac-1-000003.sst" after 100 bytes
<local fs> close: temp-file-1

Expand Down
62 changes: 31 additions & 31 deletions testdata/checkpoint
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ sync: checkpoints/checkpoint1
close: checkpoints/checkpoint1
link: db/000005.sst -> checkpoints/checkpoint1/000005.sst
link: db/000007.sst -> checkpoints/checkpoint1/000007.sst
open: db/MANIFEST-000001
open: db/MANIFEST-000001 (options: *vfs.sequentialReadsOption)
create: checkpoints/checkpoint1/MANIFEST-000001
sync-data: checkpoints/checkpoint1/MANIFEST-000001
close: checkpoints/checkpoint1/MANIFEST-000001
Expand All @@ -165,7 +165,7 @@ sync-data: checkpoints/checkpoint1/marker.manifest.000001.MANIFEST-000001
close: checkpoints/checkpoint1/marker.manifest.000001.MANIFEST-000001
sync: checkpoints/checkpoint1
close: checkpoints/checkpoint1
open: db/000006.log
open: db/000006.log (options: *vfs.sequentialReadsOption)
create: checkpoints/checkpoint1/000006.log
sync-data: checkpoints/checkpoint1/000006.log
close: checkpoints/checkpoint1/000006.log
Expand Down Expand Up @@ -193,7 +193,7 @@ close: checkpoints/checkpoint2/marker.format-version.000001.016
sync: checkpoints/checkpoint2
close: checkpoints/checkpoint2
link: db/000007.sst -> checkpoints/checkpoint2/000007.sst
open: db/MANIFEST-000001
open: db/MANIFEST-000001 (options: *vfs.sequentialReadsOption)
create: checkpoints/checkpoint2/MANIFEST-000001
sync-data: checkpoints/checkpoint2/MANIFEST-000001
close: checkpoints/checkpoint2/MANIFEST-000001
Expand All @@ -204,7 +204,7 @@ sync-data: checkpoints/checkpoint2/marker.manifest.000001.MANIFEST-000001
close: checkpoints/checkpoint2/marker.manifest.000001.MANIFEST-000001
sync: checkpoints/checkpoint2
close: checkpoints/checkpoint2
open: db/000006.log
open: db/000006.log (options: *vfs.sequentialReadsOption)
create: checkpoints/checkpoint2/000006.log
sync-data: checkpoints/checkpoint2/000006.log
close: checkpoints/checkpoint2/000006.log
Expand All @@ -229,7 +229,7 @@ sync: checkpoints/checkpoint3
close: checkpoints/checkpoint3
link: db/000005.sst -> checkpoints/checkpoint3/000005.sst
link: db/000007.sst -> checkpoints/checkpoint3/000007.sst
open: db/MANIFEST-000001
open: db/MANIFEST-000001 (options: *vfs.sequentialReadsOption)
create: checkpoints/checkpoint3/MANIFEST-000001
sync-data: checkpoints/checkpoint3/MANIFEST-000001
close: checkpoints/checkpoint3/MANIFEST-000001
Expand All @@ -240,7 +240,7 @@ sync-data: checkpoints/checkpoint3/marker.manifest.000001.MANIFEST-000001
close: checkpoints/checkpoint3/marker.manifest.000001.MANIFEST-000001
sync: checkpoints/checkpoint3
close: checkpoints/checkpoint3
open: db/000006.log
open: db/000006.log (options: *vfs.sequentialReadsOption)
create: checkpoints/checkpoint3/000006.log
sync-data: checkpoints/checkpoint3/000006.log
close: checkpoints/checkpoint3/000006.log
Expand All @@ -259,34 +259,34 @@ sync-data: db/000009.sst
close: db/000009.sst
sync: db
sync: db/MANIFEST-000001
open: db/000005.sst
open: db/000005.sst (options: *vfs.randomReadsOption)
read-at(630, 53): db/000005.sst
read-at(593, 37): db/000005.sst
read-at(74, 519): db/000005.sst
read-at(47, 27): db/000005.sst
open: db/000005.sst
open: db/000005.sst (options: *vfs.sequentialReadsOption)
close: db/000005.sst
open: db/000009.sst
open: db/000009.sst (options: *vfs.randomReadsOption)
read-at(625, 53): db/000009.sst
read-at(588, 37): db/000009.sst
read-at(69, 519): db/000009.sst
read-at(42, 27): db/000009.sst
open: db/000009.sst
open: db/000009.sst (options: *vfs.sequentialReadsOption)
close: db/000009.sst
open: db/000007.sst
open: db/000007.sst (options: *vfs.randomReadsOption)
read-at(630, 53): db/000007.sst
read-at(593, 37): db/000007.sst
read-at(74, 519): db/000007.sst
read-at(47, 27): db/000007.sst
open: db/000007.sst
open: db/000007.sst (options: *vfs.sequentialReadsOption)
close: db/000007.sst
open: db/000005.sst
open: db/000005.sst (options: *vfs.sequentialReadsOption)
read-at(0, 47): db/000005.sst
open: db/000007.sst
open: db/000007.sst (options: *vfs.sequentialReadsOption)
read-at(0, 47): db/000007.sst
create: db/000010.sst
close: db/000005.sst
open: db/000009.sst
open: db/000009.sst (options: *vfs.sequentialReadsOption)
read-at(0, 42): db/000009.sst
close: db/000007.sst
close: db/000009.sst
Expand Down Expand Up @@ -344,13 +344,13 @@ close: checkpoints/checkpoint1/000006.log

scan checkpoints/checkpoint1
----
open: checkpoints/checkpoint1/000007.sst
open: checkpoints/checkpoint1/000007.sst (options: *vfs.randomReadsOption)
read-at(630, 53): checkpoints/checkpoint1/000007.sst
read-at(593, 37): checkpoints/checkpoint1/000007.sst
read-at(74, 519): checkpoints/checkpoint1/000007.sst
read-at(47, 27): checkpoints/checkpoint1/000007.sst
read-at(0, 47): checkpoints/checkpoint1/000007.sst
open: checkpoints/checkpoint1/000005.sst
open: checkpoints/checkpoint1/000005.sst (options: *vfs.randomReadsOption)
read-at(630, 53): checkpoints/checkpoint1/000005.sst
read-at(593, 37): checkpoints/checkpoint1/000005.sst
read-at(74, 519): checkpoints/checkpoint1/000005.sst
Expand All @@ -367,7 +367,7 @@ g 10

scan db
----
open: db/000010.sst
open: db/000010.sst (options: *vfs.randomReadsOption)
read-at(657, 53): db/000010.sst
read-at(620, 37): db/000010.sst
read-at(101, 519): db/000010.sst
Expand Down Expand Up @@ -409,7 +409,7 @@ close: checkpoints/checkpoint2/000006.log

scan checkpoints/checkpoint2
----
open: checkpoints/checkpoint2/000007.sst
open: checkpoints/checkpoint2/000007.sst (options: *vfs.randomReadsOption)
read-at(630, 53): checkpoints/checkpoint2/000007.sst
read-at(593, 37): checkpoints/checkpoint2/000007.sst
read-at(74, 519): checkpoints/checkpoint2/000007.sst
Expand Down Expand Up @@ -449,13 +449,13 @@ close: checkpoints/checkpoint3/000006.log

scan checkpoints/checkpoint3
----
open: checkpoints/checkpoint3/000007.sst
open: checkpoints/checkpoint3/000007.sst (options: *vfs.randomReadsOption)
read-at(630, 53): checkpoints/checkpoint3/000007.sst
read-at(593, 37): checkpoints/checkpoint3/000007.sst
read-at(74, 519): checkpoints/checkpoint3/000007.sst
read-at(47, 27): checkpoints/checkpoint3/000007.sst
read-at(0, 47): checkpoints/checkpoint3/000007.sst
open: checkpoints/checkpoint3/000005.sst
open: checkpoints/checkpoint3/000005.sst (options: *vfs.randomReadsOption)
read-at(630, 53): checkpoints/checkpoint3/000005.sst
read-at(593, 37): checkpoints/checkpoint3/000005.sst
read-at(74, 519): checkpoints/checkpoint3/000005.sst
Expand Down Expand Up @@ -526,7 +526,7 @@ g 10
h 11
i i
k k
open: db/000014.sst
open: db/000014.sst (options: *vfs.randomReadsOption)
read-at(636, 53): db/000014.sst
read-at(599, 37): db/000014.sst
z z
Expand All @@ -550,7 +550,7 @@ close: checkpoints/checkpoint4
link: db/000010.sst -> checkpoints/checkpoint4/000010.sst
link: db/000011.sst -> checkpoints/checkpoint4/000011.sst
link: db/000014.sst -> checkpoints/checkpoint4/000014.sst
open: db/MANIFEST-000001
open: db/MANIFEST-000001 (options: *vfs.sequentialReadsOption)
create: checkpoints/checkpoint4/MANIFEST-000001
sync-data: checkpoints/checkpoint4/MANIFEST-000001
close: checkpoints/checkpoint4/MANIFEST-000001
Expand All @@ -561,7 +561,7 @@ sync-data: checkpoints/checkpoint4/marker.manifest.000001.MANIFEST-000001
close: checkpoints/checkpoint4/marker.manifest.000001.MANIFEST-000001
sync: checkpoints/checkpoint4
close: checkpoints/checkpoint4
open: db/000008.log
open: db/000008.log (options: *vfs.sequentialReadsOption)
create: checkpoints/checkpoint4/000008.log
sync-data: checkpoints/checkpoint4/000008.log
close: checkpoints/checkpoint4/000008.log
Expand All @@ -585,7 +585,7 @@ close: checkpoints/checkpoint4/000008.log

scan checkpoints/checkpoint4
----
open: checkpoints/checkpoint4/000010.sst
open: checkpoints/checkpoint4/000010.sst (options: *vfs.randomReadsOption)
read-at(657, 53): checkpoints/checkpoint4/000010.sst
read-at(620, 37): checkpoints/checkpoint4/000010.sst
read-at(101, 519): checkpoints/checkpoint4/000010.sst
Expand All @@ -597,7 +597,7 @@ d 7
e 8
f 9
g 10
open: checkpoints/checkpoint4/000011.sst
open: checkpoints/checkpoint4/000011.sst (options: *vfs.randomReadsOption)
read-at(653, 53): checkpoints/checkpoint4/000011.sst
read-at(616, 37): checkpoints/checkpoint4/000011.sst
read-at(70, 546): checkpoints/checkpoint4/000011.sst
Expand All @@ -606,7 +606,7 @@ read-at(0, 43): checkpoints/checkpoint4/000011.sst
h 11
i i
k k
open: checkpoints/checkpoint4/000014.sst
open: checkpoints/checkpoint4/000014.sst (options: *vfs.randomReadsOption)
read-at(636, 53): checkpoints/checkpoint4/000014.sst
read-at(599, 37): checkpoints/checkpoint4/000014.sst
read-at(53, 546): checkpoints/checkpoint4/000014.sst
Expand Down Expand Up @@ -654,7 +654,7 @@ close: checkpoints/checkpoint5
link: db/000010.sst -> checkpoints/checkpoint5/000010.sst
link: db/000011.sst -> checkpoints/checkpoint5/000011.sst
link: db/000014.sst -> checkpoints/checkpoint5/000014.sst
open: db/MANIFEST-000001
open: db/MANIFEST-000001 (options: *vfs.sequentialReadsOption)
create: checkpoints/checkpoint5/MANIFEST-000001
sync-data: checkpoints/checkpoint5/MANIFEST-000001
close: checkpoints/checkpoint5/MANIFEST-000001
Expand All @@ -665,7 +665,7 @@ sync-data: checkpoints/checkpoint5/marker.manifest.000001.MANIFEST-000001
close: checkpoints/checkpoint5/marker.manifest.000001.MANIFEST-000001
sync: checkpoints/checkpoint5
close: checkpoints/checkpoint5
open: db/000008.log
open: db/000008.log (options: *vfs.sequentialReadsOption)
create: checkpoints/checkpoint5/000008.log
sync-data: checkpoints/checkpoint5/000008.log
close: checkpoints/checkpoint5/000008.log
Expand Down Expand Up @@ -744,7 +744,7 @@ sync: checkpoints/checkpoint6
close: checkpoints/checkpoint6
link: db/000011.sst -> checkpoints/checkpoint6/000011.sst
link: db/000014.sst -> checkpoints/checkpoint6/000014.sst
open: db/MANIFEST-000001
open: db/MANIFEST-000001 (options: *vfs.sequentialReadsOption)
create: checkpoints/checkpoint6/MANIFEST-000001
sync-data: checkpoints/checkpoint6/MANIFEST-000001
close: checkpoints/checkpoint6/MANIFEST-000001
Expand All @@ -755,7 +755,7 @@ sync-data: checkpoints/checkpoint6/marker.manifest.000001.MANIFEST-000001
close: checkpoints/checkpoint6/marker.manifest.000001.MANIFEST-000001
sync: checkpoints/checkpoint6
close: checkpoints/checkpoint6
open: db/000008.log
open: db/000008.log (options: *vfs.sequentialReadsOption)
create: checkpoints/checkpoint6/000008.log
sync-data: checkpoints/checkpoint6/000008.log
close: checkpoints/checkpoint6/000008.log
Expand Down
12 changes: 6 additions & 6 deletions testdata/cleaner
Original file line number Diff line number Diff line change
Expand Up @@ -66,25 +66,25 @@ sync: db
sync: db/MANIFEST-000001
mkdir-all: db_wal/archive 0755
rename: db_wal/000004.log -> db_wal/archive/000004.log
open: db/000005.sst
open: db/000005.sst (options: *vfs.randomReadsOption)
read-at(744, 53): db/000005.sst
read-at(707, 37): db/000005.sst
read-at(79, 628): db/000005.sst
read-at(52, 27): db/000005.sst
open: db/000005.sst
open: db/000005.sst (options: *vfs.sequentialReadsOption)
close: db/000005.sst
open: db/000007.sst
open: db/000007.sst (options: *vfs.randomReadsOption)
read-at(718, 53): db/000007.sst
read-at(681, 37): db/000007.sst
read-at(53, 628): db/000007.sst
read-at(26, 27): db/000007.sst
open: db/000007.sst
open: db/000007.sst (options: *vfs.sequentialReadsOption)
close: db/000007.sst
open: db/000005.sst
open: db/000005.sst (options: *vfs.sequentialReadsOption)
read-at(0, 52): db/000005.sst
create: db/000008.sst
close: db/000005.sst
open: db/000007.sst
open: db/000007.sst (options: *vfs.sequentialReadsOption)
read-at(0, 26): db/000007.sst
close: db/000007.sst
sync-data: db/000008.sst
Expand Down
Loading

0 comments on commit 6b251de

Please sign in to comment.