Skip to content

PostgreSQL backup tool with Point-In-Time-Recovery and restore verification

FEATURE (agent): Extend WAL logging

Rostislav Dugin2c4e3e567ba9
diff --git a/.github/workflows/ci-release.yml b/.github/workflows/ci-release.yml
index a99142a9..ff6c0c94 100644
--- a/.github/workflows/ci-release.yml
+++ b/.github/workflows/ci-release.yml
@@ -9,6 +9,7 @@ on:
jobs:
lint-backend:
+ if: github.ref != 'refs/heads/develop'
runs-on: self-hosted
container:
image: golang:1.26.1
@@ -55,6 +56,7 @@ jobs:
git diff --exit-code go.mod go.sum || (echo "go mod tidy made changes, please run 'go mod tidy' and commit the changes" && exit 1)
lint-frontend:
+ if: github.ref != 'refs/heads/develop'
runs-on: ubuntu-latest
steps:
- name: Check out code
@@ -87,6 +89,7 @@ jobs:
npm run build
lint-agent:
+ if: github.ref != 'refs/heads/develop'
runs-on: ubuntu-latest
steps:
- name: Check out code
@@ -120,6 +123,7 @@ jobs:
git diff --exit-code go.mod go.sum || (echo "go mod tidy made changes, please run 'go mod tidy' and commit the changes" && exit 1)
test-frontend:
+ if: github.ref != 'refs/heads/develop'
runs-on: ubuntu-latest
needs: [lint-frontend]
steps:
@@ -142,6 +146,7 @@ jobs:
npm run test
test-agent:
+ if: github.ref != 'refs/heads/develop'
runs-on: ubuntu-latest
needs: [lint-agent]
steps:
@@ -165,6 +170,7 @@ jobs:
go test -count=1 -failfast ./internal/...
e2e-agent:
+ if: github.ref != 'refs/heads/develop'
runs-on: ubuntu-latest
needs: [lint-agent]
steps:
@@ -184,6 +190,7 @@ jobs:
rm -rf artifacts || true
e2e-agent-backup-restore:
+ if: github.ref != 'refs/heads/develop'
runs-on: ubuntu-latest
needs: [lint-agent]
strategy:
@@ -209,6 +216,7 @@ jobs:
# Self-hosted: performant high-frequency CPU is used to start many containers and run tests fast. Tests
# step is bottle-neck, because we need a lot of containers and cannot parallelize tests due to shared resources
test-backend:
+ if: github.ref != 'refs/heads/develop'
runs-on: self-hosted
needs: [lint-backend]
container:
@@ -539,7 +547,6 @@ jobs:
build-and-push-dev:
runs-on: self-hosted
- needs: [test-backend, test-frontend, test-agent, e2e-agent, e2e-agent-backup-restore]
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' }}
steps:
- name: Clean workspace
diff --git a/agent/internal/features/wal/streamer.go b/agent/internal/features/wal/streamer.go
index c1513fda..955a0272 100644
--- a/agent/internal/features/wal/streamer.go
+++ b/agent/internal/features/wal/streamer.go
@@ -19,7 +19,7 @@ import (
)
const (
- pollInterval = 2 * time.Second
+ pollInterval = 10 * time.Second
uploadTimeout = 5 * time.Minute
)
@@ -65,6 +65,13 @@ func (s *Streamer) processQueue(ctx context.Context) {
return
}
+ if len(segments) == 0 {
+ s.log.Info("No WAL segments pending", "dir", s.cfg.PgWalDir)
+ return
+ }
+
+ s.log.Info("WAL segments pending upload", "dir", s.cfg.PgWalDir, "count", len(segments))
+
for _, segmentName := range segments {
if ctx.Err() != nil {
return
@@ -121,6 +128,8 @@ func (s *Streamer) uploadSegment(ctx context.Context, segmentName string) error
uploadCtx, cancel := context.WithTimeout(ctx, uploadTimeout)
defer cancel()
+ s.log.Info("Uploading WAL segment", "segment", segmentName)
+
result, err := s.apiClient.UploadWalSegment(uploadCtx, segmentName, pr)
if err != nil {
return err
@@ -136,7 +145,7 @@ func (s *Streamer) uploadSegment(ctx context.Context, segmentName string) error
return fmt.Errorf("gap detected for segment %s", segmentName)
}
- s.log.Debug("WAL segment uploaded", "segment", segmentName)
+ s.log.Info("WAL segment uploaded", "segment", segmentName)
if *s.cfg.IsDeleteWalAfterUpload {
if err := os.Remove(filePath); err != nil {