ibessonov commented on code in PR #5113:
URL: https://github.com/apache/ignite-3/pull/5113#discussion_r1930578318
##########
modules/storage-api/src/main/java/org/apache/ignite/internal/storage/index/StorageHashIndexDescriptor.java:
##########
@@ -93,7 +94,7 @@ public String toString() {
* @param index Catalog index descriptor.
*/
public StorageHashIndexDescriptor(CatalogTableDescriptor table,
CatalogHashIndexDescriptor index) {
- this(index.id(), extractIndexColumnsConfiguration(table, index),
!index.isCreatedWithTable());
+ this(index.id(), extractIndexColumnsConfiguration(table, index),
index.status() == CatalogIndexStatus.REGISTERED);
Review Comment:
Yes. The main idea here was a consistency of the way you create the index
storage instances on newly joined nodes. `index.status()` is a mutable thing.
Imagine the following:
- you have a raft group with 3 nodes, but 1 is offline
- new table is created
- upload some data
- new index is created
- eventually, new index is fully built and AVAILABLE
- now you start the 3rd node
There are 2 ways to create an index storage, as you see in the constructor -
index is not built and index is fully built. In our scenario index must be
built, but it's already available. Index creation procedure is thus
inconsistent between the nodes in replication group. Even if it doesn't cause
any visible bad behavior, it is still a design flaw and we should avoid it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]