dhiaayachi / temporal

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

Regression: namespace specific search attributes have registration delay with `system.forceSearchAttributesCacheRefreshOnRead=true` #435

Open dhiaayachi opened 2 months ago

dhiaayachi commented 2 months ago

Expected Behavior

Starting a workflow immediately after registering a search attribute should succeed.

Actual Behavior

Starting a workflow immediately after registering a search attribute fails with:

INVALID_ARGUMENT: Namespace default has no mapping defined for search attribute foo

Steps to Reproduce the Problem

  1. Start Temporal server with SQLite (or any other SQL backend), for convenience use the Debug Server with SQLite VS Code launch config.
  2. Register a namespace: temporal operator namespace create default
  3. Use a client to add a search attribute
  4. Start a workflow with the added search attribute
  5. Observe the INVALID_ARGUMENT error

TypeScript snippet:

  await connection.operatorService.addSearchAttributes({
    namespace: 'default',
    searchAttributes: { foo: temporal.api.enums.v1.IndexedValueType.INDEXED_VALUE_TYPE_KEYWORD },
  });
  const client = new Client({ connection });
  const result = await client.workflow.execute(workflowType, {
    workflowId,
    taskQueue: 'test',
    args,
    searchAttributes: { foo: ['bar'] },
  });

Specifications