Manual physical snapshots start additional snapshot and retention schedulers
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Read engine/internal/srv/routes.go and engine/internal/retrieval/retrieval.go around the named createSnapshot and SnapshotData paths, then inspect engine/internal/retrieval/engine/postgres/snapshot/physical.go for scheduler startup and lifecycle. Reproduce the reported sequence of startup followed by four manual requests and observe scheduled callbacks. Done means manual snapshots do not add recurring schedulers, and snapshot and retention jobs run once per pool with operations coordinated.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
While testing physical snapshots on DBLab Engine v4.2.0, I noticed that each manual POST /snapshot request starts another recurring scheduler. After four manual snapshots, the scheduled snapshot and retention jobs run five times instead of once.
I also reproduced the scheduler behavior against the v4.2.2 retrieval code in an isolated Go test. That test skipped storage operations; it was not a full v4.2.2 database restore test.
Steps to reproduce
-
Start an engine with a ZFS pool and
physicalRestore/physicalSnapshotconfigured. -
Enable scheduled snapshots and retention. For example, this is the relevant configuration section:
retrieval: jobs: [physicalRestore, physicalSnapshot] spec: physicalSnapshot: options: scheduler: snapshot: timetable: "0 * * * *" retention: timetable: "30 * * * *" limit: 2 -
Wait for initialization to finish, then request four manual snapshots sequentially, letting each request finish before starting the next. For a pool named
test_pool:curl --fail-with-body --request POST \ --header 'Verification-Token: <token>' \ --header 'Content-Type: application/json' \ --data '{"poolName":"test_pool"}' \ http://127.0.0.1:2345/snapshot -
Check the logs at the next scheduled snapshot and retention times.
Actual behavior
- Startup logs
Snapshot scheduler has been startedonce. Each manual request adds another occurrence, without stopping the previous scheduler. - After four manual requests, five snapshot jobs start at the scheduled time. One succeeds; the others collide with it and report that the dataset already exists.
- The retention callbacks also run concurrently against the same targets. I observed
dataset is busyerrors during these overlapping cleanup attempts.
The isolated test exercised the real SnapshotData and scheduler startup path. The number of active schedulers increased from 1 -> 2 -> 3 -> 4 -> 5, and callbacks from all five fired. Cancelling the startup context stopped only the first scheduler; the four created with context.Background() continued running. The test explicitly stopped all schedulers afterward.
Expected behavior
A manual snapshot should take one snapshot without adding another recurring schedule. Scheduled snapshot creation and retention should continue running once per pool, with manual and scheduled operations coordinated.
Relevant code
createSnapshotcallsSnapshotData(context.Background(), poolName).SnapshotDataconstructs new jobs and replacesstatefulJobswithout stopping the previous jobs.PhysicalInitial.Runstarts a scheduler on return. Each instance registers both snapshot and retention callbacks and has its own mutex, so the instances do not serialize their operations with each other.
Workaround
Restarting the engine clears the extra schedulers. Avoiding manual POST /snapshot requests afterward prevents them from accumulating again.
- Lingua principale
- Go
- Stelle
- 2.8k
- Fork
- 90
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di postgres-ai/database-lab-engine
-
Mend: dependency security vulnerability
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Mend: dependency security vulnerability
Difficoltà 2/5 1-3 ore Idoneità per principianti 45/100
-
good first issue
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
postgres-ai/database-lab-engine#203 · 2 commenti ·
Tutte le issue di postgres-ai/database-lab-engine
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
evener-transcript-v2-upgrade tool still scans transcript files through bufio's 4 KiB default bufferAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
prime-radiant-inc/evener#6370 ·
I maintainer di solito rispondono entro 1 giorno
-
ManageSieve proxy: a backend's NO/BYE greeting is skipped as a capability line and reported as EOFApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Mend: dependency security vulnerability
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
ManageIQ/manageiq-pods#1476 ·
I maintainer di solito rispondono entro 1 giorno
-
mcp: typed tool handlers lose wrapped JSON-RPC errorsForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
modelcontextprotocol/go-sdk#1529 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno