Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-14148

SQL. Calcite: Failed to map fragment to location. Replicated query parts are not co-located on all nodes (state=50000,code=1)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • None
    • None
    • None
    • Docs Required, Release Notes Required

    Description

      Problem reproduced only for tables with "TEMPLATE=repl-atomic-full_sync" or "TEMPLATE=repl-tx-full_sync".

      STR:

      CREATE TABLE t7 ( id INT NOT NULL, bool_col BOOLEAN, tinyint_col TINYINT, smallint_col SMALLINT, int_col INT, bigint_col BIGINT, varchar_col VARCHAR, char_col CHAR, float_col FLOAT, double_col DOUBLE, time_col TIME, PRIMARY KEY (id)
      ) WITH "TEMPLATE=repl-tx-full_sync";
      INSERT INTO t7 (id,bool_col,tinyint_col,smallint_col,int_col,bigint_col,varchar_col,char_col,float_col,double_col,time_col) VALUES (8,TRUE,0,0,0,0,'string_8','string_8',0,8,'05:46:48'),(9,FALSE,-1,-1,-1,-1,'string_9','string_9',-1.1,9,'05:46:49'),(10,TRUE,1,1,1,1,'string_10','string_10',1.1,10,'05:46:50'),(-11,FALSE,-128,-32768,-2147483648,-9223372036854775808,'string_11','string_11',-11,11,'05:46:51'),(12,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(13,FALSE,-127,-32767,-2147483647,-9223372036854775807,'string_13','string_13',13,13,'05:46:53'),(14,TRUE,126,32766,2147483646,9223372036854775806,'string_14','string_14',14,14,'05:46:54'),(15,FALSE,15,15,15,15,'string_15','string_15',15,15,'05:46:55'),(-16,TRUE,-16,-16,-16,-16,'string_16','string_16',-16,16,'05:46:56'),(17,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
      SELECT * FROM t7 WHERE id=7 OR id=10001 ORDER BY id;
      

      Errors:

      Error: org.apache.ignite.internal.processors.query.calcite.metadata.ColocationMappingException: Failed to map fragment to location. Replicated query parts are not co-located on all nodes (state=50000,code=1)
      java.sql.SQLException: org.apache.ignite.internal.processors.query.calcite.metadata.ColocationMappingException: Failed to map fragment to location. Replicated query parts are not co-located on all nodes
      	at org.apache.ignite.internal.jdbc.thin.JdbcThinConnection.sendRequest(JdbcThinConnection.java:1009)
      	at org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute0(JdbcThinStatement.java:234)
      	at org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute(JdbcThinStatement.java:560)
      	at sqlline.Commands.execute(Commands.java:823)
      	at sqlline.Commands.sql(Commands.java:733)
      	at sqlline.SqlLine.dispatch(SqlLine.java:795)
      	at sqlline.SqlLine.runCommands(SqlLine.java:1706)
      	at sqlline.Commands.run(Commands.java:1317)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at sqlline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:38)
      	at sqlline.SqlLine.dispatch(SqlLine.java:791)
      	at sqlline.SqlLine.initArgs(SqlLine.java:595)
      	at sqlline.SqlLine.begin(SqlLine.java:643)
      	at sqlline.SqlLine.start(SqlLine.java:373)
      	at sqlline.SqlLine.main(SqlLine.java:265)
      

      Ignite log:

      [16:05:13,558][SEVERE][client-connector-#59][ClientListenerNioListener] Failed to process client request [req=JdbcQueryExecuteRequest [schemaName=PUBLIC, pageSize=1024, maxRows=0, sqlQry=SELECT * FROM t7 WHERE id=7 OR id=10001, args=Object[] [], stmtType=ANY_STATEMENT_TYPE, autoCommit=true, partResReq=false, explicitTimeout=false, super=JdbcRequest [type=2, reqId=65]]]
      java.lang.AssertionError: org.apache.ignite.internal.processors.query.calcite.metadata.ColocationMappingException: Failed to map fragment to location. Replicated query parts are not co-located on all nodes
      	at org.apache.ignite.internal.processors.query.calcite.metadata.FragmentMapping.create(FragmentMapping.java:82)
      	at org.apache.ignite.internal.processors.query.calcite.metadata.IgniteMdFragmentMapping.fragmentMapping(IgniteMdFragmentMapping.java:196)
      	at GeneratedMetadataHandler_FragmentMappingMetadata.fragmentMapping_$(Unknown Source)
      	at GeneratedMetadataHandler_FragmentMappingMetadata.fragmentMapping(Unknown Source)
      	at org.apache.ignite.internal.processors.query.calcite.metadata.RelMetadataQueryEx.fragmentMapping(RelMetadataQueryEx.java:97)
      	at org.apache.ignite.internal.processors.query.calcite.metadata.IgniteMdFragmentMapping._fragmentMapping(IgniteMdFragmentMapping.java:216)
      	at org.apache.ignite.internal.processors.query.calcite.prepare.Fragment.mapping(Fragment.java:154)
      	at org.apache.ignite.internal.processors.query.calcite.prepare.Fragment.map(Fragment.java:148)
      	at org.apache.ignite.internal.processors.query.calcite.prepare.QueryTemplate.map(QueryTemplate.java:95)
      	at org.apache.ignite.internal.processors.query.calcite.prepare.QueryTemplate.map(QueryTemplate.java:71)
      	at org.apache.ignite.internal.processors.query.calcite.prepare.AbstractMultiStepPlan.init(AbstractMultiStepPlan.java:92)
      	at org.apache.ignite.internal.processors.query.calcite.exec.ExecutionServiceImpl.executeQuery(ExecutionServiceImpl.java:672)
      	at org.apache.ignite.internal.processors.query.calcite.exec.ExecutionServiceImpl.executePlan(ExecutionServiceImpl.java:661)
      	at org.apache.ignite.internal.processors.query.calcite.exec.ExecutionServiceImpl.executePlans(ExecutionServiceImpl.java:399)
      	at org.apache.ignite.internal.processors.query.calcite.exec.ExecutionServiceImpl.executeQuery(ExecutionServiceImpl.java:381)
      	at org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.query(CalciteQueryProcessor.java:248)
      	at org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler.querySqlFields(JdbcRequestHandler.java:790)
      	at org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler.executeQuery(JdbcRequestHandler.java:673)
      	at org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler.doHandle(JdbcRequestHandler.java:341)
      	at org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler.handle(JdbcRequestHandler.java:278)
      	at org.apache.ignite.internal.processors.odbc.ClientListenerNioListener.onMessage(ClientListenerNioListener.java:202)
      	at org.apache.ignite.internal.processors.odbc.ClientListenerNioListener.onMessage(ClientListenerNioListener.java:56)
      	at org.apache.ignite.internal.util.nio.GridNioFilterChain$TailFilter.onMessageReceived(GridNioFilterChain.java:279)
      	at org.apache.ignite.internal.util.nio.GridNioFilterAdapter.proceedMessageReceived(GridNioFilterAdapter.java:109)
      	at org.apache.ignite.internal.util.nio.GridNioAsyncNotifyFilter$3.body(GridNioAsyncNotifyFilter.java:97)
      	at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:120)
      	at org.apache.ignite.internal.util.worker.GridWorkerPool$1.run(GridWorkerPool.java:70)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: org.apache.ignite.internal.processors.query.calcite.metadata.ColocationMappingException: Failed to map fragment to location. Replicated query parts are not co-located on all nodes
      	at org.apache.ignite.internal.processors.query.calcite.metadata.ColocationGroup.colocate(ColocationGroup.java:152)
      	at org.apache.ignite.internal.processors.query.calcite.metadata.FragmentMapping.create(FragmentMapping.java:79)
      	... 29 more
      

      The problem is repeated both on a single-node cluster and on a multi.

      Attachments

        1. ignite.1.node1.1.log
          324 kB
          Fedor Malchikov
        2. dml_merge_with_memory..calcite.sql.log
          74 kB
          Fedor Malchikov
        3. server.xml
          5 kB
          Fedor Malchikov
        4. caches.xml
          11 kB
          Fedor Malchikov
        5. data-reg.xml
          5 kB
          Fedor Malchikov

        Issue Links

          Activity

            People

              korlov Konstantin Orlov
              prom1se Fedor Malchikov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m