Skip to content

Snapshot list is not refreshed on a new snapshot creation

Goal

Snapshot list is not updated when a new snapshot is created (CreateSnapshot - /engine/internal/provision/thinclones/zfs/zfs.go:265):

2022/05/31 11:00:30 physical.go:787: [INFO]   Data state at:  20220531110007
2022/05/31 11:00:30 physical.go:797: [INFO]   Mark data state at:  20220531110007
2022/05/31 11:00:30 physical.go:1012: [INFO]   Run checkpoint command [psql -U postgres -d postgres -XAtc checkpoint]
2022/05/31 11:00:30 physical.go:1019: [INFO]   Checkpoint result:  CHECKPOINT
2022/05/31 11:00:30 configuration.go:377: [DEBUG]  remove /var/lib/postgresql/pools/datastore/clones/clone_pre_20220531110000/data/postgresql.dblab.recovery.conf: no such file or directory
2022/05/31 11:00:30 configuration.go:377: [DEBUG]  remove /var/lib/postgresql/pools/datastore/clones/clone_pre_20220531110000/data/standby.signal: no such file or directory
2022/05/31 11:00:30 configuration.go:377: [DEBUG]  remove /var/lib/postgresql/pools/datastore/clones/clone_pre_20220531110000/data/recovery.signal: no such file or directory
2022/05/31 11:00:30 configuration.go:471: [DEBUG]  Applying configuration:  /var/lib/postgresql/pools/datastore/clones/clone_pre_20220531110000/data/postgresql.dblab.snapshot.conf
2022/05/31 11:00:30 tools.go:270: [INFO]   Stopping PostgreSQL instance [/usr/lib/postgresql/12/bin/pg_ctl -D /var/lib/postgresql/pools/datastore/clones/clone_pre_20220531110000/data -w --timeout 600 stop]
2022/05/31 11:00:31 tools.go:372: [INFO]   Removing container ID: 9fb433522d6edf45dc204483913c348f89bc41f6bb85565da47e6006b38fa6b0
2022/05/31 11:00:36 tools.go:378: [INFO]   Container "9fb433522d6edf45dc204483913c348f89bc41f6bb85565da47e6006b38fa6b0" has been stopped
2022/05/31 11:00:36 tools.go:389: [INFO]   Container "9fb433522d6edf45dc204483913c348f89bc41f6bb85565da47e6006b38fa6b0" has been removed
2022/05/31 11:00:36 runners.go:155: [DEBUG]  Run(Local): stderr no datasets available
2022/05/31 11:00:36 runners.go:106: [DEBUG]  Run(Local): "zfs snapshot -r datastore/clone_pre_20220531110000@snapshot_20220531110007"
2022/05/31 11:00:36 runners.go:151: [DEBUG]  Run(Local): output ""
2022/05/31 11:00:36 runners.go:106: [DEBUG]  Run(Local): "zfs set dblab:datastateat="20220531110007" datastore/clone_pre_20220531110000@snapshot_20220531110007"
2022/05/31 11:00:36 runners.go:151: [DEBUG]  Run(Local): output ""
2022/05/31 11:00:36 telemetry.go:26: [DEBUG]  Send telemetry event {c7251l29engfrjnjmc4g snapshot_created {}}
2022/05/31 11:01:00 logging.go:16: [INFO]   ->  GET /snapshots
2022/05/31 11:01:00 snapshots.go:57: [DEBUG]  snapshot: {datastore/clone_pre_20220531100000@snapshot_20220531100007 2022-05-31 10:00:37 +0000 UTC 2022-05-31 10:00:07 +0000 UTC 166912 1117215294976 datastore 0}
2022/05/31 11:01:00 snapshots.go:57: [DEBUG]  snapshot: {datastore/clone_pre_20220531090000@snapshot_20220531090007 2022-05-31 09:00:36 +0000 UTC 2022-05-31 09:00:07 +0000 UTC 166400 1117214349312 datastore 0} 

With the CleanupSnapshots() method it works perfect

TODO / How to implement

Find the root cause and fix the bug

Acceptance criteria

The list of snapshots must be updated after each significant action.