Skip to content

Commit c4b0be4

Browse files
authored
Merge pull request #80 from qubic/dev
Merge dev into main
2 parents 688d269 + 7e06094 commit c4b0be4

13 files changed

Lines changed: 1138 additions & 914 deletions

File tree

.github/workflows/push-empty-ticks-endpoint.yaml renamed to .github/workflows/push-db-compactions.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Deploy dev images to GHCR
33
on:
44
push:
55
branches:
6-
- 'empty-ticks-endpoint'
6+
- 'db-compactions'
77

88
jobs:
99
push-store-image:
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Deploy dev images to GHCR
2+
3+
on:
4+
push:
5+
branches:
6+
- 'interval-quorum-data'
7+
8+
jobs:
9+
push-store-image:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: 'Checkout GitHub Action'
13+
uses: actions/checkout@main
14+
15+
- name: 'Login to GitHub Container Registry'
16+
uses: docker/login-action@v1
17+
with:
18+
registry: ghcr.io
19+
username: ${{github.actor}}
20+
password: ${{secrets.GITHUB_TOKEN}}
21+
22+
- name: 'Build Inventory Image'
23+
run: |
24+
docker build . --tag ghcr.io/qubic/qubic-archiver:${{github.ref_name}}
25+
docker push ghcr.io/qubic/qubic-archiver:${{github.ref_name}}

main.go

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"log"
1414
"os"
1515
"os/signal"
16+
"runtime"
1617
"syscall"
1718
"time"
1819
)
@@ -80,19 +81,52 @@ func run() error {
8081
}
8182
log.Printf("main: Config :\n%v\n", out)
8283

83-
levelOptions := pebble.LevelOptions{
84+
l1Options := pebble.LevelOptions{
85+
BlockRestartInterval: 16,
86+
BlockSize: 4096,
87+
BlockSizeThreshold: 90,
88+
Compression: pebble.NoCompression,
89+
FilterPolicy: nil,
90+
FilterType: pebble.TableFilter,
91+
IndexBlockSize: 4096,
92+
TargetFileSize: 268435456, // 256 MB
93+
}
94+
l2Options := pebble.LevelOptions{
95+
BlockRestartInterval: 16,
96+
BlockSize: 4096,
97+
BlockSizeThreshold: 90,
98+
Compression: pebble.ZstdCompression,
99+
FilterPolicy: nil,
100+
FilterType: pebble.TableFilter,
101+
IndexBlockSize: 4096,
102+
TargetFileSize: l1Options.TargetFileSize * 10, // 2.5 GB
103+
}
104+
l3Options := pebble.LevelOptions{
105+
BlockRestartInterval: 16,
106+
BlockSize: 4096,
107+
BlockSizeThreshold: 90,
108+
Compression: pebble.ZstdCompression,
109+
FilterPolicy: nil,
110+
FilterType: pebble.TableFilter,
111+
IndexBlockSize: 4096,
112+
TargetFileSize: l2Options.TargetFileSize * 10, // 25 GB
113+
}
114+
l4Options := pebble.LevelOptions{
84115
BlockRestartInterval: 16,
85116
BlockSize: 4096,
86117
BlockSizeThreshold: 90,
87118
Compression: pebble.ZstdCompression,
88119
FilterPolicy: nil,
89120
FilterType: pebble.TableFilter,
90121
IndexBlockSize: 4096,
91-
TargetFileSize: 2097152,
122+
TargetFileSize: l3Options.TargetFileSize * 10, // 250 GB
92123
}
93124

94125
pebbleOptions := pebble.Options{
95-
Levels: []pebble.LevelOptions{levelOptions},
126+
Levels: []pebble.LevelOptions{l1Options, l2Options, l3Options, l4Options},
127+
MaxConcurrentCompactions: func() int { return runtime.NumCPU() },
128+
MemTableSize: 268435456, // 256 MB
129+
EventListener: store.NewPebbleEventListener(),
96130
}
97131

98132
db, err := pebble.Open(cfg.Qubic.StorageFolder, &pebbleOptions)

0 commit comments

Comments
 (0)