Skip to content

Commit c3db8bd

Browse files
committed
Merge branch 'fix-blog-pgbackrest-credit' into 'master'
atom/rss quickfix, CI to auto-test rss/atom correctness, and misc improvements See merge request postgres-ai/docs!805
2 parents 621a5c6 + 81109a7 commit c3db8bd

15 files changed

+128
-23
lines changed

.ci/validate-feeds.sh

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/bin/bash
2+
# Validate RSS and Atom feeds for XML correctness
3+
4+
set -e
5+
6+
echo "Building site to generate feeds..."
7+
npm run build
8+
9+
echo ""
10+
echo "Validating RSS/Atom feeds..."
11+
12+
BUILD_DIR="build"
13+
FEEDS=("$BUILD_DIR/blog/rss.xml" "$BUILD_DIR/blog/atom.xml" "$BUILD_DIR/blog/feed.json")
14+
15+
EXIT_CODE=0
16+
17+
for feed in "${FEEDS[@]}"; do
18+
if [ ! -f "$feed" ]; then
19+
echo "❌ Feed not found: $feed"
20+
EXIT_CODE=1
21+
continue
22+
fi
23+
24+
# For XML feeds (rss.xml, atom.xml), validate with xmllint
25+
if [[ "$feed" == *.xml ]]; then
26+
echo "Validating XML: $feed"
27+
if xmllint --noout "$feed" 2>&1; then
28+
echo "✅ Valid XML: $feed"
29+
else
30+
echo "❌ Invalid XML: $feed"
31+
echo "Showing first 50 lines around errors:"
32+
xmllint --noout "$feed" 2>&1 | head -20
33+
EXIT_CODE=1
34+
fi
35+
fi
36+
37+
# For JSON feed, validate with jq
38+
if [[ "$feed" == *.json ]]; then
39+
echo "Validating JSON: $feed"
40+
if jq empty "$feed" 2>&1; then
41+
echo "✅ Valid JSON: $feed"
42+
else
43+
echo "❌ Invalid JSON: $feed"
44+
EXIT_CODE=1
45+
fi
46+
fi
47+
done
48+
49+
echo ""
50+
if [ $EXIT_CODE -eq 0 ]; then
51+
echo "✅ All feeds are valid!"
52+
else
53+
echo "❌ Feed validation failed!"
54+
fi
55+
56+
exit $EXIT_CODE
57+

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
.env.development.local
1515
.env.test.local
1616
.env.production.local
17+
static/raw
1718

1819
npm-debug.log*
1920
yarn-debug.log*
2021
yarn-error.log*
2122

22-
.idea/
23+
.idea/

.gitlab-ci.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
image: docker:20.10.12
44

55
stages:
6+
- validate
67
- prepare_image
78
- deploy
89

@@ -14,6 +15,26 @@ variables:
1415
TAG_LATEST: "${REGISTRY}:${NAMESPACE}-latest"
1516
DOCS_NAME: "docs"
1617

18+
# Validate RSS/Atom feeds before building and deploying
19+
validate_feeds:
20+
stage: validate
21+
image: node:18
22+
before_script:
23+
# Install xmllint for XML validation
24+
- apt-get update && apt-get install -y libxml2-utils jq
25+
- npm ci
26+
script:
27+
- bash .ci/validate-feeds.sh
28+
artifacts:
29+
when: on_failure
30+
paths:
31+
- build/blog/*.xml
32+
- build/blog/*.json
33+
expire_in: 1 week
34+
only:
35+
- merge_requests
36+
- master
37+
1738
# Stages templates.
1839
.job_template: &build_and_push_definition
1940
stage: prepare_image

blog/20210728-code-and-data.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description: 'Comprehensive Testing Covers Code AND Data'
88
weight: 0
99
image: /assets/thumbnails/dle-generic-blog.png
1010
tags:
11-
- Guides & best practices
11+
- Guides and best practices
1212
- Postgres.ai
1313
- Database Lab
1414
- Software Testing

blog/20210923-zero-downtime-postgres-schema-migrations-lock-timeout-and-retries.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ description: 'Deploying DB schema changes in heavily loaded systems is challengi
99
weight: 0
1010
image: /assets/thumbnails/graceful-db-migrations.png
1111
tags:
12-
- Guides & best practices
12+
- Guides and best practices
1313
- database migrations
1414
- database schema migrations
1515
- DDL

blog/20220525-common-db-schema-change-mistakes.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description: "Common DB schema change mistakes and how to avoid them in PostgreS
88
weight: 0
99
image: /assets/thumbnails/20220525-common-db-schema-change-mistakes_thumbnail.jpg
1010
tags:
11-
- Guides & best practices
11+
- Guides and best practices
1212
- Schema migrations
1313
---
1414

blog/20221125-cheaper-faster.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description: 'Test environments that are 10x cheaper and 10x faster than RDS clo
88
weight: 0
99
image: /assets/thumbnails/elephants-in-sky-painting2.jpg
1010
tags:
11-
- Guides & best practices
11+
- Guides and best practices
1212
- Postgres.ai
1313
- Database Lab
1414
- Software Testing

blog/20230722-10-postgres-tips-for-beginners.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ description: "<div><img src=\"/assets/thumbnails/20230722-10-postgres-tips-for-b
1010
weight: 0
1111
image: /assets/thumbnails/20230722-10-postgres-tips-for-beginners-3.jpg
1212
tags:
13-
- Guides & best practices
13+
- Guides and best practices
1414
- Postgres tips
1515
---
1616

blog/20250724-postgres-howtos-launch.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ date: 2025-07-24 20:00:00
44
publishDate: 2025-07-24 20:00:00
55
authors: [nik]
66
image: /assets/thumbnails/20250724-postgres-howtos-launch.png
7-
tags: [Guides & best practices, Launch Week, postgres, howtos, documentation]
7+
tags: [Guides and best practices, Launch Week, postgres, howtos, documentation]
88
---
99

1010
# Introducing Postgres how-tos: practical guides for real-world database challenges

blog/20251105-postgres-marathon-2-012.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: "#PostgresMarathon 2-012: Ultra-fast replica creation with pgBackRest"
33
date: 2025-11-05 23:59:59
4+
slug: 20251105-postgres-marathon-2-012-ultra-fast-replica-creation-pgbackrest
45
authors: [nik, maxim]
56
tags: [Postgres insights, PostgresMarathon, cloning, pgBackRest, performance]
67
---
@@ -39,7 +40,7 @@ Multi-threaded pg_basebackup has been a recurring topic on pgsql-hackers over th
3940

4041
## Alternative: pgBackRest
4142

42-
pgBackRest is a direct replacement that becomes efficient with `--process-max=8` or higher. The setup requires no special configuration on the source database neither Postgres nor pgBackRest need to be pre-configured on the primary server.
43+
pgBackRest is primarily a backup and restore tool for Postgres, but nothing prevents using it to copy a data directory from one server to another which is exactly what we need for replica creation. This approach becomes highly efficient with `--process-max=8` or higher. The setup requires no special configuration on the source database neither Postgres nor pgBackRest need to be pre-configured on the primary server.
4344

4445
### Prerequisites
4546

0 commit comments

Comments
 (0)