dhiaayachi / temporal

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

Search Attributes fail to be added when executed back to back #414

Open dhiaayachi opened 2 months ago

dhiaayachi commented 2 months ago

Expected Behavior

All the search attributes should have been added when using the temporal operator search-attribute create command back-to-back.

Actual Behavior

When executing the following command:

temporal operator search-attribute list | grep Custom
  CustomStringField           Text

You can see that only one search attribute was added.

Steps to Reproduce the Problem

In the terminal, execute the following commands:

  1. temporal server start-dev
  2. temporal operator search-attribute create --name CustomIntField --type Int
  3. temporal operator search-attribute create --name CustomDatetimeField --type Datetime
  4. temporal operator search-attribute create --name CustomKeywordField --type Keyword
  5. temporal operator search-attribute create --name CustomBoolField --type Bool
  6. temporal operator search-attribute create --name CustomDoubleField --type Double
  7. temporal operator search-attribute create --name CustomStringField --type Text

Workaround

In testing, it looks like if you execute the following command:

temporal operator search-attribute create \
    --name CustomIntField --type Int \
    --name CustomDatetimeField --type Datetime \
    --name CustomKeywordField --type Keyword \
    --name CustomBoolField --type Bool \
    --name CustomDoubleField --type Double \
    --name CustomStringField --type Text

This would save all the search attributes.

Specifications

dhiaayachi commented 1 month ago

Thank you for reporting this issue.

It looks like you've discovered a bug in the temporal operator search-attribute create command. It should have created all of the Search Attributes with the single command in your workaround.

We are currently working on resolving this issue and will update the documentation once it's fixed.

In the meantime, please use the workaround you've identified:

temporal operator search-attribute create \
    --name CustomIntField --type Int \
    --name CustomDatetimeField --type Datetime \
    --name CustomKeywordField --type Keyword \
    --name CustomBoolField --type Bool \
    --name CustomDoubleField --type Double \
    --name CustomStringField --type Text

This command will successfully create all the Search Attributes.