Skip to content

Commit

Permalink
Improving docs on this
Browse files Browse the repository at this point in the history
  • Loading branch information
sebasmannem committed Feb 17, 2022
1 parent a206bee commit e471a50
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions docs/PostgreSQL.md
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,11 @@ WAL-G will also prefetch WAL files ahead of asked WAL file. These files will be
wal-g wal-fetch example-archive new-file-name
```

Note: ``wal-fetch`` will exit with errorcode 74 (EX_IOERR: input/output error, see sysexits.h for more info) if the WAL-file is not available in the repository.
All other errors end in exit code 1, and should stop PostgreSQL rather than ending PostgreSQL recovery.
For PostgreSQL that should be any error code between 126 and 255, which can be achieved with a simple wrapper script.
Please see https://github.com/wal-g/wal-g/pull/1195 for more information.

### ``wal-push``

When uploading WAL archives to S3, the user should pass in the absolute path to where the archive is located.
Expand Down
5 changes: 4 additions & 1 deletion internal/databases/postgres/wal_fetch_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ import (
"github.com/wal-g/wal-g/utility"
)

// Looking at sysexits.h, EX_IOERR (74) is defined as a generic exit code for input/output errors
const exIoError=74

type InvalidWalFileMagicError struct {
error
}
Expand Down Expand Up @@ -98,7 +101,7 @@ func HandleWALFetch(folder storage.Folder, walFileName string, location string,
err := internal.DownloadFileTo(folder, walFileName, location)
if _, isArchNonExistErr := err.(internal.ArchiveNonExistenceError); isArchNonExistErr {
tracelog.ErrorLogger.Print(err.Error())
os.Exit(74)
os.Exit(exIoError)
} else {
tracelog.ErrorLogger.FatalOnError(err)
}
Expand Down

0 comments on commit e471a50

Please sign in to comment.