gpdb icon indicating copy to clipboard operation
gpdb copied to clipboard

Project pg_basebackup/pg_rewind errors to gprecoverseg output

Open ShirishaRao opened this issue 2 years ago • 4 comments

Currently when gprecoverseg fails, it records the error in a log file. This log file can be pg_basebackup/pg_rewind file depending on the type of recovery the failed segments were undergoing. So in case of gprecoverseg failure, the user has to navigate through the log file to get the reason for failure.

With these changes it will enable the user to get a primal understanding on the reason for failure by displaying a snippet of error on console. Gprecoverseg will obtain last occurring error/panic/fatal message from the log file and display it. For more details the user can dive into the reported logfile.

20231106:15:28:00:087928 gprecoverseg:sshirishaXG4C7:sshirisha-[INFO]:------------------------------- 20231106:15:28:00:087928 gprecoverseg:sshirishaXG4C7:sshirisha-[INFO]:-Failed to recover the following segments 20231106:15:28:00:087928 gprecoverseg:sshirishaXG4C7:sshirisha-[INFO]:- hostname: sshirishaXG4C7.vmware.com; port: 7004; logfile: /Users/sshirisha/gpAdminLogs/pg_basebackup.20231106_152757.dbid4.out; recoverytype: full; error: pg_basebackup: error: could not get write-ahead log end position from server: ERROR: could not open file "./tmpfile": Permission denied

Startup related errors are reported either in startup.log or latest gpdb*.csv file. This depends on the state of postmaster process when this error occurred. So latest error is fetched from both the files and the one with latest timestamp among these is reported on console.

Here are some reminders before you submit the pull request

  • [ ] Add tests for the change
  • [ ] Document changes
  • [ ] Communicate in the mailing list if needed
  • [ ] Pass make installcheck
  • [ ] Review a PR in return to support the community

ShirishaRao avatar Nov 06 '23 10:11 ShirishaRao