[ https://issues.apache.org/jira/browse/IGNITE-24212?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Vladimir Steshin updated IGNITE-24212: -------------------------------------- Description: *Consider:* 1) There is a working non-persistent cluster with defined caches in _IgniteConfiguration_. 2) The caches have no SQL-entities set. 3) Node creates table over one of these cache with `_CREATE TABLE IF NOT EXISTS_`. A SQL table and a schema appear in the cluster. 4) One of the nodes restarts. 5) Next `_SELECT_` queries to the table may fail with '_TABLE NOT FOUND'_ 6) Restarted node has no tables in system view '_TABLES_'. *Cause:* The node restarts with defined cache configurations having no SQL entities set. When node joins cluster, dynamic tables/schema seem not merged or validated. The restarting node takes own cache configuration as is, without dynamically created schema and tables and has no the tables. +This works+ with the persistence because node stores and reads the cache meta holding the schema/entities. +Same happens+ with the persistence but with erased node's data. *Workarounds:* 1) Do not predefine caches, create them with `_CREATE TABLE_` 2) Set matching SQL entities in the predefined cache config. 3) Use other cache names with `_CREATE TABLE_` (_WITH "CACHE_NAME=._..). *Suggestions:* 1) Validate schema/caches and do not allow node join cluster. or 2) Merge static and dynamic schemas/cache configs and send them to the joining node. was: *Consider:* 1) There is a working non-persistent cluster with defined caches in _IgniteConfiguration_. 2) The caches have no SQL-entities set. 3) Node creates table over one of these cache with `_CREATE TABLE IF NOT EXISTS_`. A SQL table and a schema appear in the cluster. 4) One of the nodes restarts. 5) Next `_SELECT_` queries to the table may fail with '_TABLE NOT FOUND'_ 6) Restarted node has no tables in system view '_TABLES_'. *Cause:* The node restarts with defined cache configurations having no SQL entities set. When node joins cluster, dynamic tables/schema seem not merged or validated. The restarting node takes own cache configuration as is, without dynamically created schema and tables and has no the tables. +This works+ with the persistence because node stores and reads the cache meta holding the schema/entities. *Workarounds:* 1) Do not predefine caches, create them with `_CREATE TABLE_` 2) Set matching SQL entities in the predefined cache config. 3) Use other cache names with `_CREATE TABLE_` (_WITH "CACHE_NAME=._..). *Suggestions:* 1) Validate schema/caches and do not allow node join cluster. or 2) Merge static and dynamic schemas/cache configs and send them to the joining node. Summary: SQL schema might not be merged on node join. (was: Non-persistent SQL schema isn't merged or validated when node joins cluster.) > SQL schema might not be merged on node join. > -------------------------------------------- > > Key: IGNITE-24212 > URL: https://issues.apache.org/jira/browse/IGNITE-24212 > Project: Ignite > Issue Type: Bug > Affects Versions: 2.14, 2.16 > Reporter: Vladimir Steshin > Assignee: Vladimir Steshin > Priority: Minor > Labels: ise, sql > Attachments: TestNonPersistentNodeRestartsWithDynamicSQLTable.java > > > *Consider:* > 1) There is a working non-persistent cluster with defined caches in > _IgniteConfiguration_. > 2) The caches have no SQL-entities set. > 3) Node creates table over one of these cache with `_CREATE TABLE IF NOT > EXISTS_`. A SQL table and a schema appear in the cluster. > 4) One of the nodes restarts. > 5) Next `_SELECT_` queries to the table may fail with '_TABLE NOT FOUND'_ > 6) Restarted node has no tables in system view '_TABLES_'. > *Cause:* > The node restarts with defined cache configurations having no SQL entities > set. When node joins cluster, dynamic tables/schema seem not merged or > validated. The restarting node takes own cache configuration as is, without > dynamically created schema and tables and has no the tables. > +This works+ with the persistence because node stores and reads the cache > meta holding the schema/entities. > +Same happens+ with the persistence but with erased node's data. > *Workarounds:* > 1) Do not predefine caches, create them with `_CREATE TABLE_` > 2) Set matching SQL entities in the predefined cache config. > 3) Use other cache names with `_CREATE TABLE_` (_WITH "CACHE_NAME=._..). > *Suggestions:* > 1) Validate schema/caches and do not allow node join cluster. > or > 2) Merge static and dynamic schemas/cache configs and send them to the > joining node. -- This message was sent by Atlassian Jira (v8.20.10#820010)