You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "tkalkirill (via GitHub)" <gi...@apache.org> on 2024/02/28 13:13:52 UTC

[PR] IGNITE-21610 Upgrade tuples when inserting into indexes on a full state transfer [ignite-3]

tkalkirill opened a new pull request, #3311:
URL: https://github.com/apache/ignite-3/pull/3311

   https://issues.apache.org/jira/browse/IGNITE-21610
   
   Thank you for submitting the pull request.
   
   To streamline the review process of the patch and ensure better code quality
   we ask both an author and a reviewer to verify the following:
   
   ### The Review Checklist
   - [ ] **Formal criteria:** TC status, codestyle, mandatory documentation. Also make sure to complete the following:  
   \- There is a single JIRA ticket related to the pull request.  
   \- The web-link to the pull request is attached to the JIRA ticket.  
   \- The JIRA ticket has the Patch Available state.  
   \- The description of the JIRA ticket explains WHAT was made, WHY and HOW.  
   \- The pull request title is treated as the final commit message. The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
   - [ ] **Design:** new code conforms with the design principles of the components it is added to.
   - [ ] **Patch quality:** patch cannot be split into smaller pieces, its size must be reasonable.
   - [ ] **Code quality:** code is clean and readable, necessary developer documentation is added if needed.
   - [ ] **Tests code quality:** test set covers positive/negative scenarios, happy/edge cases. Tests are effective in terms of execution time and resources.
   
   ### Notes
   - [Apache Ignite Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Java+Code+Style+Guide)


-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-21610 Upgrade tuples when inserting into indexes on a full state transfer [ignite-3]

Posted by "tkalkirill (via GitHub)" <gi...@apache.org>.
tkalkirill commented on code in PR #3311:
URL: https://github.com/apache/ignite-3/pull/3311#discussion_r1507063165


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/raft/snapshot/FullStateTransferIndexChooser.java:
##########
@@ -317,4 +337,23 @@ private long findStoppingActivationTsBusy(int indexId, int toCatalogVersionInclu
     private Set<Integer> tableIds(int catalogVersion) {
         return catalogService.tables(catalogVersion).stream().map(CatalogObjectDescriptor::id).collect(toSet());
     }
+
+    private int tableVersionBusy(CatalogIndexDescriptor index, int catalogVersion) {
+        CatalogTableDescriptor table = catalogService.table(index.tableId(), catalogVersion);
+
+        assert table != null : "indexId=" + index.id() + ", tableId=" + index.tableId() + ", catalogVersion=" + catalogVersion;
+
+        return table.tableVersion();
+    }
+
+    private List<IndexIdAndTableVersion> toIndexIdAndTableVersionList(List<Integer> indexIds) {

Review Comment:
   why not



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-21610 Upgrade tuples when inserting into indexes on a full state transfer [ignite-3]

Posted by "rpuch (via GitHub)" <gi...@apache.org>.
rpuch commented on code in PR #3311:
URL: https://github.com/apache/ignite-3/pull/3311#discussion_r1506029981


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/raft/snapshot/FullStateTransferIndexChooser.java:
##########
@@ -317,4 +337,23 @@ private long findStoppingActivationTsBusy(int indexId, int toCatalogVersionInclu
     private Set<Integer> tableIds(int catalogVersion) {
         return catalogService.tables(catalogVersion).stream().map(CatalogObjectDescriptor::id).collect(toSet());
     }
+
+    private int tableVersionBusy(CatalogIndexDescriptor index, int catalogVersion) {
+        CatalogTableDescriptor table = catalogService.table(index.tableId(), catalogVersion);
+
+        assert table != null : "indexId=" + index.id() + ", tableId=" + index.tableId() + ", catalogVersion=" + catalogVersion;
+
+        return table.tableVersion();
+    }
+
+    private List<IndexIdAndTableVersion> toIndexIdAndTableVersionList(List<Integer> indexIds) {

Review Comment:
   How about calling this `enrichWithTableVersions`?



##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/index/IndexUpdateHandler.java:
##########
@@ -65,10 +65,33 @@ public void addToIndexes(@Nullable BinaryRow binaryRow, RowId rowId, @Nullable L
         }
 
         for (TableSchemaAwareIndexStorage index : indexes(indexIds)) {
+            // TODO: IGNITE-21514 Handle index destruction
             index.put(binaryRow, rowId);
         }
     }
 
+    /**
+     * Adds a binary row to the index, if the tombstone then skips such operation.

Review Comment:
   ```suggestion
        * Adds a binary row to the index, if it's a tombstone then skips such operation.
   ```



##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/raft/snapshot/IndexIdAndTableVersion.java:
##########
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.table.distributed.raft.snapshot;
+
+import org.apache.ignite.internal.tostring.S;
+
+/** Container the index ID and table schema version at index creation. */

Review Comment:
   ```suggestion
   /** Container for index ID and table schema version at index creation. */
   ```



##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/raft/snapshot/IndexIdAndBinaryRow.java:
##########
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.table.distributed.raft.snapshot;
+
+import org.apache.ignite.internal.schema.BinaryRow;
+
+/** Container the index ID and {@link BinaryRow}. */

Review Comment:
   ```suggestion
   /** Container for index ID and {@link BinaryRow}. */
   ```



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-21610 Upgrade tuples when inserting into indexes on a full state transfer [ignite-3]

Posted by "tkalkirill (via GitHub)" <gi...@apache.org>.
tkalkirill merged PR #3311:
URL: https://github.com/apache/ignite-3/pull/3311


-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-21610 Upgrade tuples when inserting into indexes on a full state transfer [ignite-3]

Posted by "tkalkirill (via GitHub)" <gi...@apache.org>.
tkalkirill commented on code in PR #3311:
URL: https://github.com/apache/ignite-3/pull/3311#discussion_r1507063805


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/raft/snapshot/IndexIdAndBinaryRow.java:
##########
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.table.distributed.raft.snapshot;
+
+import org.apache.ignite.internal.schema.BinaryRow;
+
+/** Container the index ID and {@link BinaryRow}. */

Review Comment:
   apply 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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-21610 Upgrade tuples when inserting into indexes on a full state transfer [ignite-3]

Posted by "tkalkirill (via GitHub)" <gi...@apache.org>.
tkalkirill commented on code in PR #3311:
URL: https://github.com/apache/ignite-3/pull/3311#discussion_r1507052979


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/index/IndexUpdateHandler.java:
##########
@@ -65,10 +65,33 @@ public void addToIndexes(@Nullable BinaryRow binaryRow, RowId rowId, @Nullable L
         }
 
         for (TableSchemaAwareIndexStorage index : indexes(indexIds)) {
+            // TODO: IGNITE-21514 Handle index destruction
             index.put(binaryRow, rowId);
         }
     }
 
+    /**
+     * Adds a binary row to the index, if the tombstone then skips such operation.

Review Comment:
   apply 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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-21610 Upgrade tuples when inserting into indexes on a full state transfer [ignite-3]

Posted by "tkalkirill (via GitHub)" <gi...@apache.org>.
tkalkirill commented on code in PR #3311:
URL: https://github.com/apache/ignite-3/pull/3311#discussion_r1507064217


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/raft/snapshot/IndexIdAndTableVersion.java:
##########
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.table.distributed.raft.snapshot;
+
+import org.apache.ignite.internal.tostring.S;
+
+/** Container the index ID and table schema version at index creation. */

Review Comment:
   apply 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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org