Skip to content

Commit

Permalink
[BACKPORT 2024.1][#21947] YSQL: fix postgres process crash on "show a…
Browse files Browse the repository at this point in the history
…ll" command

Summary:
To reproduce this bug:

```
./bin/ysqlsh -c "show all"
server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
connection to server was lost
```

The reason is that a GUC variable must have a non-NULL short_desc that the "show
all" command needs to access. When I added the new GUC
`yb_enable_ddl_atomicity_infra` in commit
6091cc8, I added the text description to
long_desc when it should be short_desc. Fixed by swapping them.
Jira: DB-10864

Original commit: 7036256 / D34147

Test Plan:
(1) Manual test, `show all` now works

./bin/ysqlsh -c "show all"

(2) Run the original benchbase test in the issue and it now passes
1. Start a local RF-3 cluster
   ./bin/yb-ctl create --rf 3
2. Build benchbase.jar
export JAVA_HOME=/opt/jdk-17
export PATH=$PATH:$JAVA_HOME/bin
cd $HOME/code
rm -rf benchbase
git clone https://github.com/yugabyte/benchbase.git
cd benchbase
./mvnw clean package -P yugabyte -DskipTests
cd target
tar xvzf benchbase-yugabyte.tgz
cd benchbase-yugabyte/
3. Run the test command and see no PG process crash.
/opt/jdk-17/bin/java -Xmx8g -jar benchbase.jar -b voter -c config/yugabyte/sample_voter_config.xml --create=true --load=true --execute=true --params endpoint=127.0.0.1 -im 5000 2>&1

Reviewers: fizaa, smishra

Reviewed By: smishra

Subscribers: yql

Tags: #jenkins-ready

Differential Revision: https://phorge.dev.yugabyte.com/D34185
  • Loading branch information
myang2021 committed Apr 16, 2024
1 parent c6b05ba commit 91dcda6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/postgres/src/backend/utils/misc/guc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2484,9 +2484,9 @@ static struct config_bool ConfigureNamesBool[] =

{
{"yb_enable_ddl_atomicity_infra", PGC_SUSET, DEVELOPER_OPTIONS,
NULL,
gettext_noop("Used along side with yb_ddl_rollback_enabled to control "
"whether DDL atomicity is enabled."),
NULL,
GUC_NOT_IN_SAMPLE
},
&yb_enable_ddl_atomicity_infra,
Expand Down

0 comments on commit 91dcda6

Please sign in to comment.