Commit 654bc3f 1 parent 677890b commit 654bc3f Copy full SHA for 654bc3f
File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -285,7 +285,8 @@ func (h *OperatorHandlerImpl) addSearchAttributesSQL(
285
285
return serviceerror .NewUnavailable (fmt .Sprintf (errUnableToGetNamespaceInfoMessage , nsName ))
286
286
}
287
287
288
- customSearchAttributes := currentSearchAttributes .Custom ()
288
+ dbCustomSearchAttributes := searchattribute .GetSqlDbIndexSearchAttributes ().CustomSearchAttributes
289
+ cmCustomSearchAttributes := currentSearchAttributes .Custom ()
289
290
mapper := ns .CustomSearchAttributesMapper ()
290
291
fieldToAliasMap := util .CloneMapNonNil (mapper .FieldToAliasMap ())
291
292
for saName , saType := range request .GetSearchAttributes () {
@@ -298,10 +299,14 @@ func (h *OperatorHandlerImpl) addSearchAttributesSQL(
298
299
// find the first available field for the given type
299
300
targetFieldName := ""
300
301
cntUsed := 0
301
- for fieldName , fieldType := range customSearchAttributes {
302
+ for fieldName , fieldType := range dbCustomSearchAttributes {
302
303
if fieldType != saType {
303
304
continue
304
305
}
306
+ // make sure the pre-allocated custom search attributes are created in cluster metadata
307
+ if _ , ok := cmCustomSearchAttributes [fieldName ]; ! ok {
308
+ continue
309
+ }
305
310
if _ , ok := fieldToAliasMap [fieldName ]; ! ok {
306
311
targetFieldName = fieldName
307
312
break
You can’t perform that action at this time.
0 commit comments