Copilot commented on code in PR #11461:
URL: https://github.com/apache/gravitino/pull/11461#discussion_r3370723040


##########
docs/how-to-upgrade.md:
##########
@@ -98,8 +100,12 @@ Gravitino. The files in this directory with names like
 corresponding to each of the released versions of Gravitino. You can
 determine differences between your schema and the official schema
 by comparing the contents of the official dump with the schema dump
-you created in the previous step. Some differences are acceptable and will not 
interfere
-with the upgrade process, but others need to be resolved manually
+you created in the previous step.
+

Review Comment:
   This PR is marked as fixing #11112, but Step 4 still doesn’t include a 
concrete command/example for comparing the dumped schema against the official 
schema file. Adding a simple `diff` example (and a direct reference to 
`scripts/postgresql/schema-x.y.z-postgresql.sql`) would make the instructions 
actionable and address the original issue request.



##########
docs/how-to-upgrade.md:
##########
@@ -49,8 +49,10 @@ by creating a copy of the directory containing your database.
 For PostgreSQL, you can use the following command to backup your database:
 
 ```shell
-pg_dump -U username -h hostname -d database_name -n schema_name -a -F c -f 
data_backup.sql
+pg_dump -U username -h hostname -d database_name -n schema_name -Fc -f 
data_backup.dump
 ```
+The `-Fc` option produces a compressed binary dump in PostgreSQL's
+custom format, which can be restored with `pg_restore`.

Review Comment:
   The added PostgreSQL backup guidance correctly switches to a custom-format 
`.dump`, but the IRC PostgreSQL example just below still uses custom format 
(`-F c`) while writing to a `.sql` file. That’s misleading because the output 
won’t be plain SQL and should be restored with `pg_restore` (same as the main 
backup).



##########
docs/how-to-upgrade.md:
##########
@@ -206,4 +212,43 @@ Confirm the running image tag matches the target version:
 kubectl get pods -n <namespace> -o 
jsonpath='{.items[*].spec.containers[*].image}'
 ```
 
+## Rollback if Upgrade Fails
+
+If you encounter errors during the upgrade process, you can
+restore your database from the backup created in Step 2.
+
+### MySQL
+
+Use the backup file to restore your database. The `mysqldump`
+backup contains `DROP TABLE` statements by default (via `--opt`),
+so it will replace the upgraded tables automatically:
+
+```shell
+mysql -u username -h hostname <db_name> < backup.sql

Review Comment:
   The MySQL rollback command uses `<db_name>` inside the shell command (`mysql 
... <db_name> < backup.sql`). In a shell, the `<` characters are 
input-redirection operators, so copying this literally will fail. Use a 
placeholder without angle brackets (or pass the DB via `--database`).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to