File tree Expand file tree Collapse file tree 8 files changed +19
-13
lines changed
github.com/CortexFoundation/torrentfs Expand file tree Collapse file tree 8 files changed +19
-13
lines changed Original file line number Diff line number Diff line change @@ -86,15 +86,15 @@ func (f *chainFreezer) Close() error {
8686// This functionality is deliberately broken off from block importing to avoid
8787// incurring additional data shuffling delays on block propagation.
8888func (f * chainFreezer ) freeze (db ctxcdb.KeyValueStore ) {
89- nfdb := & nofreezedb {KeyValueStore : db }
90-
9189 var (
9290 backoff bool
9391 triggered chan struct {} // Used in tests
92+ nfdb = & nofreezedb {KeyValueStore : db }
9493 )
9594
9695 timer := time .NewTimer (freezerRecheckInterval )
9796 defer timer .Stop ()
97+
9898 for {
9999 select {
100100 case <- f .quit :
Original file line number Diff line number Diff line change @@ -860,8 +860,11 @@ func (t *freezerTable) advanceHead() error {
860860 if err != nil {
861861 return err
862862 }
863-
864- // Close old file, and reopen in RDONLY mode.
863+ // Commit the contents of the old file to stable storage and
864+ // tear it down. It will be re-opened in read-only mode.
865+ if err := t .head .Sync (); err != nil {
866+ return err
867+ }
865868 t .releaseFile (t .headId )
866869 t .openFile (t .headId , openFreezerFileForReadOnly )
867870
Original file line number Diff line number Diff line change @@ -194,7 +194,7 @@ func TestFreezerConcurrentModifyTruncate(t *testing.T) {
194194
195195 var item = make ([]byte , 256 )
196196
197- for i := 0 ; i < 1000 ; i ++ {
197+ for i := 0 ; i < 10 ; i ++ {
198198 // First reset and write 100 items.
199199 if err := f .TruncateHead (0 ); err != nil {
200200 t .Fatal ("truncate failed:" , err )
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ require (
66 github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.4.1
77 github.com/CortexFoundation/inference v1.0.2-0.20221114235728-985486629a61
88 github.com/CortexFoundation/statik v0.0.0-20210315012922-8bb8a7b5dc66
9- github.com/CortexFoundation/torrentfs v1.0.35-0.20230112224026-33d896151830
9+ github.com/CortexFoundation/torrentfs v1.0.35-0.20230114014057-c7a532b00dfd
1010 github.com/VictoriaMetrics/fastcache v1.12.0
1111 github.com/arsham/figurine v1.3.0
1212 github.com/aws/aws-sdk-go-v2 v1.17.3
Original file line number Diff line number Diff line change @@ -87,8 +87,8 @@ github.com/CortexFoundation/statik v0.0.0-20210315012922-8bb8a7b5dc66/go.mod h1:
8787github.com/CortexFoundation/torrentfs v1.0.13-0.20200623060705-ce027f43f2f8 /go.mod h1:Ma+tGhPPvz4CEZHaqEJQMOEGOfHeQBiAoNd1zyc/w3Q =
8888github.com/CortexFoundation/torrentfs v1.0.14-0.20200703071639-3fcabcabf274 /go.mod h1:qnb3YlIJmuetVBtC6Lsejr0Xru+1DNmDCdTqnwy7lhk =
8989github.com/CortexFoundation/torrentfs v1.0.20-0.20200810031954-d36d26f82fcc /go.mod h1:N5BsicP5ynjXIi/Npl/SRzlJ630n1PJV2sRj0Z0t2HA =
90- github.com/CortexFoundation/torrentfs v1.0.35-0.20230112224026-33d896151830 h1:HMwK8zr9r6NGcdlLH216FkKs3y42jytYR6bPASY2VQQ =
91- github.com/CortexFoundation/torrentfs v1.0.35-0.20230112224026-33d896151830 /go.mod h1:pzLgyzw0Su0ekjYCfTQ3T8aoTCpYULhbV7exUyUpV6w =
90+ github.com/CortexFoundation/torrentfs v1.0.35-0.20230114014057-c7a532b00dfd h1:Xg3SGG6slPdNSpP+ALcMmlU2+2PPnEk4eMQZycCaftA =
91+ github.com/CortexFoundation/torrentfs v1.0.35-0.20230114014057-c7a532b00dfd /go.mod h1:pzLgyzw0Su0ekjYCfTQ3T8aoTCpYULhbV7exUyUpV6w =
9292github.com/DATA-DOG/go-sqlmock v1.3.3 /go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM =
9393github.com/DATA-DOG/go-sqlmock v1.4.1 h1:ThlnYciV1iM/V0OSF/dtkqWb6xo5qITT1TJBG1MRDJM =
9494github.com/HdrHistogram/hdrhistogram-go v1.1.0 h1:6dpdDPTRoo78HxAJ6T1HfMiKSnqhgRRqzCuPshRkQ7I =
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ github.com/CortexFoundation/merkletree
5353# github.com/CortexFoundation/statik v0.0.0-20210315012922-8bb8a7b5dc66
5454## explicit; go 1.16
5555github.com/CortexFoundation/statik
56- # github.com/CortexFoundation/torrentfs v1.0.35-0.20230112224026-33d896151830
56+ # github.com/CortexFoundation/torrentfs v1.0.35-0.20230114014057-c7a532b00dfd
5757## explicit; go 1.19
5858github.com/CortexFoundation/torrentfs
5959github.com/CortexFoundation/torrentfs/backend
You can’t perform that action at this time.
0 commit comments