Skip to content

Conversation

@yycptt
Copy link
Member

@yycptt yycptt commented Dec 30, 2025

What changed?

  • Support separate ID spaces for different archetypes in SQL persistence.

Why?

  • Separate ID space workstream

How did you test it?

  • built
  • run locally and tested manually
  • covered by existing tests
  • added new unit test(s)
  • added new functional test(s)

@yycptt yycptt requested review from a team as code owners December 30, 2025 01:14
ctx context.Context,
row *sqlplugin.CurrentExecutionsRow,
) (sql.Result, error) {
if row.ArchetypeID == chasm.WorkflowArchetypeID {
Copy link
Contributor

@prathyushpv prathyushpv Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we also need to check for 0 here for backward compatibility?
like archetypeID == chasm.WorkflowArchetypeID || archetypeID == chasm.UnspecifiedArchetypeID

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, not really. Even for existing executions, application layer will pass down chasm.WorkflowArchetypeID.

There's also a check in execution manager to guarantee that 0 is never used: https://github.com/temporalio/temporal/blob/main/common/persistence/execution_manager.go#L1186


func (s *ExecutionMutableStateSuite) TestArchetypeSeparateIDSpace() {
if strings.HasPrefix(s.T().Name(), "TestCassandra") {
s.T().Skip("Separate ID space is only implemented by sql persistence")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remember to remove this after merging Cassandra changes.

SetupPostgreSQLSchema(p.T(), cfg)
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
if err != nil {
p.T().Fatalf("unable to create MySQL DB: %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
p.T().Fatalf("unable to create MySQL DB: %v", err)
p.T().Fatalf("unable to create PostgreSQL DB: %v", err)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants