dhiaayachi / temporal

Temporal service
https://docs.temporal.io
MIT License
0 stars 0 forks source link

postgres plugin no longer supported for default schema in 1.24.0? #136

Open dhiaayachi opened 2 months ago

dhiaayachi commented 2 months ago

running 1.23.1, I have the postgres driver for the default schmea, and postgres_12 for the visibility schema (in order to have advanced visibilty.)

when I upgrade to 1.24.0, I get this error:

[Fx] Error returned: received non-nil error from function "go.temporal.io/server/temporal".ServerOptionsProvider
    /home/runner/work/docker-builds/docker-builds/temporal/temporal/fx.go:183:
sql schema version compatibility check failed: not supported plugin postgres, only supported: map[mysql8:0x42f15c0 postgres12:0xc000721380 postgres12_pgx:0xc000721390 sqlite:0x42aef78]
[Fx] ERROR      Failed to initialize custom logger: could not build arguments for function "go.uber.org/fx".(*module).constructCustomLogger.func2
    /home/runner/go/pkg/mod/go.uber.org/fx@v1.21.1/module.go:292:
failed to build fxevent.Logger:
could not build arguments for function "go.temporal.io/server/temporal".glob..func8
    /home/runner/work/docker-builds/docker-builds/temporal/temporal/fx.go:1009:
failed to build log.Logger:
received non-nil error from function "go.temporal.io/server/temporal".ServerOptionsProvider
    /home/runner/work/docker-builds/docker-builds/temporal/temporal/fx.go:183:
sql schema version compatibility check failed: not supported plugin postgres, only supported: map[mysql8:0x42f15c0 postgres12:0xc000721380 postgres12_pgx:0xc000721390 sqlite:0x42aef78]
Unable to create server. Error: could not build arguments for function "go.uber.org/fx".(*module).constructCustomLogger.func2 (/home/runner/go/pkg/mod/go.uber.org/fx@v1.21.1/module.go:292): failed to build fxevent.Logger: could not build arguments for function "go.temporal.io/server/temporal".glob..func8 (/home/runner/work/docker-builds/docker-builds/temporal/temporal/fx.go:1009): failed to build log.Logger: received non-nil error from function "go.temporal.io/server/temporal".ServerOptionsProvider (/home/runner/work/docker-builds/docker-builds/temporal/temporal/fx.go:183): sql schema version compatibility check failed: not supported plugin postgres, only supported: map[mysql8:0x42f15c0 postgres12:0xc000721380 postgres12_pgx:0xc000721390 sqlite:0x42aef78].

I'm guessing that means I need to switch to the postgres12 plugin for the default schema now as well?

That's no problem for me, I'm running postgres16. Just wondering if this is expected; I didn't see it mentioned in the release notes.

dhiaayachi commented 1 month ago

You are correct! The error message you're seeing indicates that you need to switch to the postgres12 plugin for both your default schema and visibility schema in Temporal Server v1.24.0 and beyond.

Here's a breakdown of the issue and the necessary steps:

The Problem

Temporal Server v1.24.0 introduces a change in the supported plugins for PostgreSQL. Previously, you could use the postgres plugin for both the default schema and the visibility schema. Now, the postgres12 plugin is required for both.

Why the Change?

This change aligns with Temporal's support for advanced visibility features, which require PostgreSQL 12 or higher. The postgres12 plugin ensures compatibility with these features and better performance.

What to Do

  1. Update Your Database Schema:

    • Default Schema: Run the temporal-sql-tool with the postgres12 plugin to update your default schema.
    • Visibility Schema: You're already using postgres12 for your visibility schema, so no further action is needed here.
  2. Reconfigure Your Temporal Server:

    • Update your Temporal Server configuration to use the postgres12 plugin for both your default schema and visibility schema.

Additional Considerations

Reference Links

Let me know if you have any further questions or need more guidance on the upgrade process.

dhiaayachi commented 1 month ago

Thanks for reporting this issue!

You are correct, Temporal Server v1.24.0 and later require using the postgres12 driver for the default schema as well. You can switch to the postgres12 plugin for your default schema, but remember, it needs to match your PostgreSQL version (which you're already running on version 16).

This change was not documented in the release notes and will be updated in the upcoming release notes.

dhiaayachi commented 1 month ago

Thanks for reporting this! It appears you are running into an issue with Temporal's SQL schema compatibility when upgrading from 1.23.1 to 1.24.0.

It seems that the postgres plugin is no longer supported, and only postgres12, postgres12_pgx, mysql8, and sqlite are supported. You'll need to migrate your default schema to use the postgres12 plugin.

You can follow the instructions for upgrading the schema found here: https://docs.temporal.io/self-hosted-guide/upgrade-server. You will need to use the temporal-sql-tool to upgrade your schema.

Let me know if you have any other questions!

dhiaayachi commented 1 month ago

Thanks for reporting this issue! It seems like you're running into an incompatibility between the postgres driver and Temporal Server 1.24.0.

Temporal Server 1.24.0 requires the postgres12 driver for the default schema. As you're using PostgreSQL 16, you'll need to switch to the postgres12 driver for both your default and visibility schemas.

You can change the driver in your Temporal configuration. Refer to the Server Options documentation for more details on how to do this.

dhiaayachi commented 1 month ago

Thanks for reporting this. This is a known issue and has been addressed in Temporal Server 1.24.0.

The postgres plugin has been deprecated in favor of the postgres12 plugin, which provides better performance and compatibility. This means that you need to switch to the postgres12 plugin for both your default schema and your visibility schema.

Please refer to the Temporal Server release notes for more details on the upgrade process and any other changes made in the latest version.

You can find the documentation for the postgres12 plugin here.