File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99 type : string
1010
1111permissions :
12- contents : read
12+ contents : write
1313
1414jobs :
1515 badger-build-amd64 :
9595 path : |
9696 badger/badger-checksum-linux-arm64.sha256
9797 badger/badger-linux-arm64.tar.gz
98+
99+ upload-to-release :
100+ runs-on : ubuntu-latest
101+ needs : [badger-build-amd64, badger-build-arm64]
102+ steps :
103+ - name : Download all build artifacts
104+ uses : actions/download-artifact@v4
105+ with :
106+ path : artifacts
107+ merge-multiple : true
108+ - name : List downloaded artifacts
109+ run : ls -alR artifacts/
110+ - name : Upload assets to GitHub Release
111+ env :
112+ GH_TOKEN : ${{ github.token }}
113+ run : |
114+ gh release upload "${{ github.event.inputs.releasetag }}" \
115+ artifacts/badger-linux-amd64.tar.gz \
116+ artifacts/badger-checksum-linux-amd64.sha256 \
117+ artifacts/badger-linux-arm64.tar.gz \
118+ artifacts/badger-checksum-linux-arm64.sha256 \
119+ --repo "${{ github.repository }}"
Original file line number Diff line number Diff line change 2222 - pb/*.pb.go
2323 enabled :
2424 - golangci-lint2@2.4.0
25- - trivy@0.64.1
25+ - trivy@0.69.3
2626 - renovate@41.76.0
2727 - actionlint@1.7.7
2828 - checkov@3.2.461
Original file line number Diff line number Diff line change @@ -671,6 +671,11 @@ const (
671671// Sync syncs database content to disk. This function provides
672672// more control to user to sync data whenever required.
673673func (db * DB ) Sync () error {
674+ if db .opt .InMemory {
675+ // InMemory mode does not use WAL/vlog files, so Sync is a no-op.
676+ return nil
677+ }
678+
674679 /**
675680 Make an attempt to sync both the logs, the active memtable's WAL and the vLog (1847).
676681 Cases:
Original file line number Diff line number Diff line change @@ -2159,6 +2159,19 @@ func TestSyncForReadingTheEntriesThatWereSynced(t *testing.T) {
21592159 }
21602160}
21612161
2162+ func TestSyncInMemoryNoError (t * testing.T ) {
2163+ opt := getTestOptions ("" )
2164+ opt .InMemory = true
2165+
2166+ runBadgerTest (t , & opt , func (t * testing.T , db * DB ) {
2167+ err := db .Update (func (txn * Txn ) error {
2168+ return txn .Set ([]byte ("key" ), []byte ("value" ))
2169+ })
2170+ require .NoError (t , err )
2171+ require .NoError (t , db .Sync ())
2172+ })
2173+ }
2174+
21622175func TestForceFlushMemtable (t * testing.T ) {
21632176 dir , err := os .MkdirTemp ("" , "badger-test" )
21642177 require .NoError (t , err , "temp dir for badger could not be created" )
You can’t perform that action at this time.
0 commit comments