Skip to content

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

TEST (physical): Cover summarize_wal NULL scan on PostgreSQL < 17 (issue

Rostislav Dugind3cea5904e25
diff --git a/CLAUDE.md b/CLAUDE.md
index f9aa601d..badcaff5 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -115,6 +115,10 @@ After each change run linting and formatting depending on folder you are working
- backend and agent has `make lint` commands
- frontend has `pnpm lint` and `pnpm format` commands
+### Comments are a last resort
+
+The default is **no comment**. Before writing one, reach for a clearer name or a smaller function first — self-explanatory code beats commented code every time. A comment is justified only when it carries something the code cannot: a *why* (business rule, hidden cross-system constraint, non-obvious algorithm or optimisation, ADR reference). Never write a comment that restates *what* the code does or narrates the obvious — if a `// Foo does X` comment sits above the code, that's a naming bug: rename until the comment is redundant, then delete it. This applies everywhere, tests included — a well-named test needs no header comment explaining what it checks.
+
### No "how it was" comments, no unrequested backward compatibility
Don't write comments that explain previous behavior ("used to be X", "was renamed from Y", "kept for legacy callers"). Code shows the current state; history lives in git.
diff --git a/backend/internal/features/databases/databases/postgresql/physical/model_test.go b/backend/internal/features/databases/databases/postgresql/physical/model_test.go
index 19970abe..8cecf497 100644
--- a/backend/internal/features/databases/databases/postgresql/physical/model_test.go
+++ b/backend/internal/features/databases/databases/postgresql/physical/model_test.go
@@ -533,6 +533,20 @@ func Test_TestReplicationConnection_FailsForFullIncrementalWalStreamWhenSummariz
}
}
+func Test_ReadReplicationSettings_OnPreSummarizeWalVersion_DefaultsSummarizeWalToOff(t *testing.T) {
+ source := containers.StartPostgres(t, "postgres:16")
+
+ conn := openTestConnAt(t, source.Host, source.Port)
+
+ ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
+ defer cancel()
+
+ settings, err := readReplicationSettings(ctx, conn)
+
+ require.NoError(t, err)
+ assert.Equal(t, "off", settings.summarizeWal)
+}
+
func Test_TestReplicationConnection_SucceedsForFullOnlyWhenSummarizeWalOff(t *testing.T) {
for _, fx := range physicalFixtures() {
t.Run(fx.name, func(t *testing.T) {