Skip to content

Commit

Permalink
Fix postgres archiver doc and change proxyRef -> databaseRef for Prox…
Browse files Browse the repository at this point in the history
…ysql Autoscaler (#659)

Signed-off-by: souravbiswassanto <[email protected]>
  • Loading branch information
souravbiswassanto authored Aug 14, 2024
1 parent 0496b01 commit 70e1103
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
25 changes: 15 additions & 10 deletions docs/guides/postgres/pitr/archiver.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,13 @@ spec:
scheduler:
successfulJobsHistoryLimit: 1
failedJobsHistoryLimit: 1
schedule: "/30 * * * *"
schedule: "30 * * * *"
sessionHistoryLimit: 2
manifestBackup:
scheduler:
successfulJobsHistoryLimit: 1
failedJobsHistoryLimit: 1
schedule: "/30 * * * *"
schedule: "30 * * * *"
sessionHistoryLimit: 2
backupStorage:
ref:
Expand Down Expand Up @@ -288,16 +288,21 @@ hi=# create table tab_1 (a int);
CREATE TABLE
hi=# insert into tab_1 values(generate_series(1,100));
INSERT 0 100
hi=# select pg_switch_wal();
0/504A0D8
(1 row)

# we will restore here. till now we have 100 rows
hi=# select now();
2023-12-12 13:43:41.300216+00

# This insert is necessary unless postgres will wait
# for data to be available at `2023-12-12 13:43:41.300216+00`
# regardless of our switch wal operation
hi=# insert into tab_1 values(generate_series(1,100));
INSERT 0 100

hi=# select now();
2023-12-12 13:43:41.300216+00

# switching wall so that this wal is available when we restore
# in general this will be archived when either of them occurs
# - archive_timeout passed
# - wal file gets full by wal record
hi=# select pg_switch_wal();
0/6013240

Expand Down Expand Up @@ -325,7 +330,7 @@ LINE 1: select count(*) from tab_1 ;
We can't restore from a full backup since at this point no full backup was perform. so we can choose a specific time in which time we want to restore.We can get the specfice time from the wal that archived in the backup storage . Go to the binlog file and find where to store. You can parse wal-files using `pg-waldump`.
For the demo I will use the previous time we get form `select now()`
For the demo I will use the previous time we got from `select now()`
```bash
hi=# select now();
Expand Down Expand Up @@ -399,7 +404,7 @@ bash-5.1$ psql
postgres=# \c hi
hi=# select count(*) from tab_1 ;
200
100
```
**so we are able to successfully recover from a disaster**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: proxy-as-compute
namespace: demo
spec:
proxyRef:
databaseRef:
name: proxy-server
opsRequestOptions:
timeout: 3m
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/proxysql/autoscaler/compute/cluster/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ metadata:
name: proxy-as-compute
namespace: demo
spec:
proxyRef:
databaseRef:
name: proxy-server
opsRequestOptions:
timeout: 3m
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/proxysql/concepts/autoscaler/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ metadata:
name: psops-autoscale
namespace: demo
spec:
proxyRef:
databaseRef:
name: sample-proxysql
compute:
proxysql:
Expand Down Expand Up @@ -73,4 +73,4 @@ All of them has the following sub-fields:
- `containerControlledValues` specifies which resource values should be controlled. Allowed values are "RequestsAndLimits" and "RequestsOnly".
- `resourceDiffPercentage` specifies the minimum resource difference between recommended value and the current value in percentage. If the difference percentage is greater than this value than autoscaling will be triggered.
- `podLifeTimeThreshold` specifies the minimum pod lifetime of at least one of the pods before triggering autoscaling.
- `InMemoryScalingThreshold` the percentage of the Memory that will be passed as inMemorySizeGB for inmemory database engine, which is only available for the percona variant of the proxysql.
- `InMemoryScalingThreshold` the percentage of the Memory that will be passed as inMemorySizeGB for inmemory database engine, which is only available for the percona variant of the proxysql.

0 comments on commit 70e1103

Please sign in to comment.