Skip to content

Commit f55e065

Browse files
committed
Merge branch 'v2.0' into 'master'
feat: skip creation of the snapshot on start (#187) See merge request postgres-ai/database-lab!199
2 parents 108ff35 + e86904c commit f55e065

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

configs/config.example.physical_generic.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ retrieval:
167167

168168
physicalSnapshot:
169169
options:
170+
# Skip taking a snapshot while the retrieval starts.
171+
skipStartSnapshot: false
172+
170173
# Promote PGDATA after data fetching.
171174
promotion:
172175
# Enable PGDATA promotion.

configs/config.example.physical_walg.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@ retrieval:
153153

154154
physicalSnapshot:
155155
options:
156+
# Skip taking a snapshot while the retrieval starts.
157+
skipStartSnapshot: false
158+
156159
# Promote PGDATA after data fetching.
157160
promotion:
158161
# Enable PGDATA promotion.

pkg/retrieval/engine/postgres/snapshot/physical.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ type PhysicalInitial struct {
8282

8383
// PhysicalOptions describes options for a physical initialization job.
8484
type PhysicalOptions struct {
85+
SkipStartSnapshot bool `yaml:"skipStartSnapshot"`
8586
Promotion Promotion `yaml:"promotion"`
8687
PreprocessingScript string `yaml:"preprocessingScript"`
8788
Configs map[string]string `yaml:"configs"`
@@ -203,6 +204,12 @@ func (p *PhysicalInitial) Run(ctx context.Context) (err error) {
203204
default:
204205
}
205206

207+
if p.options.SkipStartSnapshot {
208+
log.Msg("Skip taking a snapshot at the start")
209+
210+
return nil
211+
}
212+
206213
p.dbMark.DataStateAt = extractDataStateAt(p.dbMarker)
207214

208215
// Snapshot data.

0 commit comments

Comments
 (0)