You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "rpuch (via GitHub)" <gi...@apache.org> on 2023/09/28 11:28:32 UTC
[GitHub] [ignite-3] rpuch commented on a diff in pull request #2638: IGNITE-20505 Preparing to implement IndexBuildController
rpuch commented on code in PR #2638:
URL: https://github.com/apache/ignite-3/pull/2638#discussion_r1339973745
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/index/IndexBuilder.java:
##########
@@ -158,24 +159,29 @@ public void stopBuildIndex(int tableId, int partitionId, int indexId) {
* @param partitionId Partition ID.
*/
public void stopBuildIndexes(int tableId, int partitionId) {
- for (Iterator<Entry<IndexBuildTaskId, IndexBuildTask>> it = indexBuildTaskById.entrySet().iterator(); it.hasNext(); ) {
- if (!busyLock.enterBusy()) {
- return;
- }
+ stopBuildIndexes(taskId -> tableId == taskId.getTableId() && partitionId == taskId.getPartitionId());
+ }
- try {
- Entry<IndexBuildTaskId, IndexBuildTask> entry = it.next();
+ /**
+ * Stops building indexes for all table partition if they are in progress.
+ *
+ * @param indexId Index ID.
+ */
+ public void stopBuildIndexes(int indexId) {
Review Comment:
```suggestion
public void stopBuildingIndexes(int indexId) {
```
##########
modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java:
##########
@@ -348,13 +348,10 @@ private void startIndexes() {
assert table != null : "tableId=" + tableId + ", indexId=" + index.id();
- CompletableFuture<?> fireCreateIndexEventFuture = fireCreateIndexEvent(index, causalityToken, catalogVersion);
-
- CompletableFuture<Void> registerIndexFuture = registerIndex(table, index, causalityToken);
-
- startIndexFutures.add(allOf(fireCreateIndexEventFuture, registerIndexFuture));
+ startIndexFutures.add(registerIndexBusyAsync(table, index, causalityToken));
}
+ // Forces to wait until recovery is complete before the metastore watches is deployed to avoid races with other components.
Review Comment:
```suggestion
// Forces to wait until recovery is complete before the metastore watches are deployed to avoid races with other components.
```
--
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