CREATE TABLE is synchronous but INSERT immediately after fails with "Table not found"
Summary
After executing a CREATE TABLE command via JDBC (through MyBatis in a Spring Boot application), an immediate INSERT operation fails with a "table not found" error. However, retrying the same INSERT shortly after succeeds. This seems to contradict the documentation which states that CREATE TABLE is synchronous.
Environment
- Apache Ignite version: [2.17]
- Mode: Embedded
- Spring Boot + HikariCP + MyBatis
- JVM: [OpenJDK 11]
- Persistence: [Enabled]
- Number of nodes: [1]
Steps to Reproduce
- Start Ignite in embedded mode within a Spring Boot application.
- Run
CREATE TABLE audit_2510 (...)usingsqlSessionTemplate.update(...)via MyBatis. - Immediately attempt to
INSERTinto the created table. - Observe the error:
Table not found: audit_2510 - Retry the same
INSERTafter a few milliseconds → it succeeds.
Expected Behavior
Since CREATE TABLE is documented as synchronous, the table should be available for DML (INSERT) immediately after creation.
Actual Behavior
The first INSERT fails with a "table not found" error. This suggests that although the CREATE TABLE call returns successfully, the table may not yet be fully available in the SQL context.
Reference
- Official documentation:
CREATE TABLE— Apache Ignite Docs
"The CREATE TABLE command is synchronous and creates a table with the specified columns."
Additional Notes
- Introducing a delay or polling
INFORMATION_SCHEMA.TABLESbefore performing theINSERTsolves the issue. - Possibly related to metadata propagation delay or SQL context sync timing in embedded mode.
- This behavior can cause flaky tests or production bugs in high-concurrency systems.
Question
Is this behavior expected under certain conditions (e.g., embedded mode, client thread timing), or should CREATE TABLE fully guarantee DML readiness when it returns?