GPText: Index creation failed when the hostname contains illegal character
search cancel

GPText: Index creation failed when the hostname contains illegal character

book

Article ID: 296675

calendar_today

Updated On:

Products

VMware Tanzu Greenplum

Issue/Introduction

The standard hostname naming rule can be found in RFC 952: https://tools.ietf.org/html/rfc952

1. A "name" (Net, Host, Gateway, or Domain name) is a text string up
   to 24 characters drawn from the alphabet (A-Z), digits (0-9), minus
   sign (-), and period (.).


When a hostname contains some illegal character, such as underscore "_", creating index might fail with a timeout error.

The following is an example hostnames with an illegal character - support_gpddb6_sdw01 and support_gpddb6_sdw02 as solr node.

In the solr log, we can see creating index failed due to timeout:

2021-04-09 21:08:01.610 INFO  (qtp1629687658-23) [   ] o.a.s.h.a.CollectionsHandler Invoked Collection Action :create with params replicationFactor=2&shards=shard0,shard1,shard2,shard3&collection.configName=demo.public.message&maxShardsPerNode=2000&name=demo.public.message&router.name=implicit&action=CREATE&wt=xml and sendToOCPQueue=true
2021-04-09 21:08:03.033 INFO  (qtp1629687658-23) [   ] o.a.s.h.a.CollectionsHandler Wait for new collection to be active for at most 30 seconds. Check all shard replicas
2021-04-09 21:08:33.035 ERROR (qtp1629687658-23) [   ] o.a.s.h.a.CollectionsHandler Timed out waiting for new collection's replicas to become ACTIVE with timeout=30
2021-04-09 21:08:33.035 INFO  (qtp1629687658-23) [   ] o.a.s.s.HttpSolrCall [admin] webapp=null path=/admin/collections params={replicationFactor=2&shards=shard0,shard1,shard2,shard3&collection.configName=demo.public.message&maxShardsPerNode=2000&name=demo.public.message&router.name=implicit&action=CREATE&wt=xml} status=0 QTime=31444 


In the error from the PSQL client, we can clearly see that the URL was turned into http://support/gpddb6_sdw02:18984_solr, instead of http://support_gpddb6_sdw02:18984_solr

demo=# SELECT * FROM gptext.create_index('public','message', 'id', 'message_text');
WARNING:  org.apache.solr.client.solrj.SolrServerException:Server at http://support/gpddb6_sdw02:18984_solr sent back a redirect (301).. (AdminUDF.cpp:446)
CONTEXT:  SQL statement "SELECT gptext.__create_index_impl(fq_name, db_name, schema_name, table_name, if_check_id_uniqueness, if_partition_index)"
PL/pgSQL function gptext.__create_index(text,text,text,text,boolean,boolean,text[],text[]) line 176 at SQL statement
WARNING:  Collection: 'demo.public.message' does not exist. (SearchingService.cpp:978)
CONTEXT:  SQL statement "SELECT gptext.__drop_index_impl(index_name)"
PL/pgSQL function gptext.__index_create_post_check(text,text,boolean,boolean) line 7 at SQL statement
SQL statement "SELECT gptext.__index_create_post_check(fq_name, id_col_name, success, use_uuid_as_id)"
PL/pgSQL function gptext.__create_index(text,text,text,text,boolean,boolean,text[],text[]) line 191 at PERFORM
ERROR:  Create index operation failed.
CONTEXT:  SQL statement "SELECT gptext.__index_create_post_check(fq_name, id_col_name, success, use_uuid_as_id)"
PL/pgSQL function gptext.__create_index(text,text,text,text,boolean,boolean,text[],text[]) line 191 at PERFORM
demo=# SELECT * FROM gptext.create_index('public','message', 'id', 'message_text');
WARNING:  org.apache.solr.client.solrj.SolrServerException:Server at http://support/gpddb6_sdw02:18984_solr sent back a redirect (301).. (AdminUDF.cpp:446)
CONTEXT:  SQL statement "SELECT gptext.__create_index_impl(fq_name, db_name, schema_name, table_name, if_check_id_uniqueness, if_partition_index)"
PL/pgSQL function gptext.__create_index(text,text,text,text,boolean,boolean,text[],text[]) line 176 at SQL statement
WARNING:  Collection: 'demo.public.message' does not exist. (SearchingService.cpp:978)
CONTEXT:  SQL statement "SELECT gptext.__drop_index_impl(index_name)"
PL/pgSQL function gptext.__index_create_post_check(text,text,boolean,boolean) line 7 at SQL statement
SQL statement "SELECT gptext.__index_create_post_check(fq_name, id_col_name, success, use_uuid_as_id)"
PL/pgSQL function gptext.__create_index(text,text,text,text,boolean,boolean,text[],text[]) line 191 at PERFORM
ERROR:  Create index operation failed.
CONTEXT:  SQL statement "SELECT gptext.__index_create_post_check(fq_name, id_col_name, success, use_uuid_as_id)"
PL/pgSQL function gptext.__create_index(text,text,text,text,boolean,boolean,text[],text[]) line 191 at PERFORM
demo=# select * from gptext.index_summary;
ERROR:  relation "gptext.index_summary" does not exist
LINE 1: select * from gptext.index_summary;



Environment

Product Version: 6.15

Resolution

This issue can be fixed by removing the illegal character from the hostname. For example, changing the hostname from support_gpddb6_sdw02 to support-gpddb6-sdw02.