[
https://issues.apache.org/jira/browse/IGNITE-26588?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18024400#comment-18024400
]
Roman Puchkovskiy commented on IGNITE-26588:
--------------------------------------------
If there are too few partitions of the given zone, some nodes might not host
any of them. When such nodes recover, they don't have in the
localPartsByTableId for the given table. Then, when an index is registered
(after creation), a null is returned from the map and gets dereferenced.
This can be fixed if we never return a null from localPartitionSetAsync()'s
future; instead, we should return an empty partition set.
> Index creation fails after node restart
> ---------------------------------------
>
> Key: IGNITE-26588
> URL: https://issues.apache.org/jira/browse/IGNITE-26588
> Project: Ignite
> Issue Type: Bug
> Reporter: Roman Puchkovskiy
> Assignee: Roman Puchkovskiy
> Priority: Critical
> Labels: ignite-3
> Time Spent: 10m
> Remaining Estimate: 0h
>
> The following test
> {code:java}
> class TestTest extends BaseSqlIntegrationTest {
> private static final String ZONE_NAME = "ZONE_TABLE";
> private static final String TABLE_NAME = "TEST_TABLE";
> @Test
> void test() {
> sql(format("CREATE ZONE IF NOT EXISTS {} (REPLICAS {}, PARTITIONS {})
> STORAGE PROFILES ['{}']",
> ZONE_NAME, 1, 1, DEFAULT_STORAGE_PROFILE
> ));
> sql(format(
> "CREATE TABLE {} (i0 INTEGER PRIMARY KEY, i1 INTEGER) ZONE
> {}",
> TABLE_NAME, ZONE_NAME
> ));
> CLUSTER.restartNode(2);
> sql(format("CREATE INDEX idx ON {}(i1)", TABLE_NAME));
> }
> } {code}
> produces the following error in the restarted node logs:
> {noformat}
> Caused by: java.lang.NullPointerException: Cannot invoke
> "org.apache.ignite.internal.table.distributed.PartitionSet.stream()" because
> "partitions" is null
> at
> org.apache.ignite.internal.table.TableImpl.registerSortedIndex(TableImpl.java:296)
> at
> org.apache.ignite.internal.table.distributed.index.IndexUtils.registerIndexToTable(IndexUtils.java:62)
> at
> org.apache.ignite.internal.index.IndexManager.registerIndex(IndexManager.java:308)
> at
> org.apache.ignite.internal.index.IndexManager.lambda$startIndexAsync$9(IndexManager.java:293)
> at
> org.apache.ignite.internal.util.IgniteUtils.inBusyLock(IgniteUtils.java:883)
> at
> org.apache.ignite.internal.index.IndexManager.lambda$startIndexAsync$10(IndexManager.java:292){noformat}
> It seems that localPartsByTableId is not recovered on node start for existing
> tables (at least, when colocation is enabled).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)