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/10/12 16:32:45 UTC
[PR] IGNITE-20635 Cleanup code wrt IGNITE-18733 mentions [ignite-3]
rpuch opened a new pull request, #2686:
URL: https://github.com/apache/ignite-3/pull/2686
https://issues.apache.org/jira/browse/IGNITE-20635
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-20635 Cleanup code wrt IGNITE-18733 mentions [ignite-3]
Posted by "tkalkirill (via GitHub)" <gi...@apache.org>.
tkalkirill merged PR #2686:
URL: https://github.com/apache/ignite-3/pull/2686
--
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-20635 Cleanup code wrt IGNITE-18733 mentions [ignite-3]
Posted by "tkalkirill (via GitHub)" <gi...@apache.org>.
tkalkirill commented on code in PR #2686:
URL: https://github.com/apache/ignite-3/pull/2686#discussion_r1357850062
##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItBuildIndexTest.java:
##########
@@ -181,25 +177,8 @@ TABLE_NAME, toValuesString(List.of(1, 1), List.of(2, 2), List.of(3, 3), List.of(
));
}
- private static void createIndex(String indexName) throws Exception {
+ private static void createIndex(String indexName) {
sql(IgniteStringFormatter.format("CREATE INDEX {} ON {} (i1)", indexName, TABLE_NAME));
-
- waitForIndex(indexName);
Review Comment:
Why did you remove the index wait?
##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgniteNodeRestartTest.java:
##########
@@ -1230,13 +1226,11 @@ private void createTableWithData(List<IgniteImpl> nodes, String name, int replic
}
}
- private void waitForIndex(Collection<IgniteImpl> nodes, String indexName) throws InterruptedException {
- // FIXME: Wait for the index to be created on all nodes,
- // this is a workaround for https://issues.apache.org/jira/browse/IGNITE-18733 to avoid missed updates to the PK index.
+ private void waitForIndexToBecomeAvailable(Collection<IgniteImpl> nodes, String indexName) throws InterruptedException {
assertTrue(waitForCondition(
() -> nodes.stream()
.map(nodeImpl -> nodeImpl.catalogManager().index(indexName.toUpperCase(), nodeImpl.clock().nowLong()))
- .allMatch(Objects::nonNull),
+ .allMatch(indexDescriptor -> indexDescriptor != null && !indexDescriptor.writeOnly()),
Review Comment:
I think it's better to use `org.apache.ignite.internal.catalog.events.CatalogEvent#INDEX_AVAILABLE`.
--
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-20635 Cleanup code wrt IGNITE-18733 mentions [ignite-3]
Posted by "rpuch (via GitHub)" <gi...@apache.org>.
rpuch commented on code in PR #2686:
URL: https://github.com/apache/ignite-3/pull/2686#discussion_r1357910484
##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgniteNodeRestartTest.java:
##########
@@ -1230,13 +1226,11 @@ private void createTableWithData(List<IgniteImpl> nodes, String name, int replic
}
}
- private void waitForIndex(Collection<IgniteImpl> nodes, String indexName) throws InterruptedException {
- // FIXME: Wait for the index to be created on all nodes,
- // this is a workaround for https://issues.apache.org/jira/browse/IGNITE-18733 to avoid missed updates to the PK index.
+ private void waitForIndexToBecomeAvailable(Collection<IgniteImpl> nodes, String indexName) throws InterruptedException {
assertTrue(waitForCondition(
() -> nodes.stream()
.map(nodeImpl -> nodeImpl.catalogManager().index(indexName.toUpperCase(), nodeImpl.clock().nowLong()))
- .allMatch(Objects::nonNull),
+ .allMatch(indexDescriptor -> indexDescriptor != null && !indexDescriptor.writeOnly()),
Review Comment:
The event only brings index ID, not its name, but we only have name here, and to find index ID we must wait till the index descriptor appears in the catalog; so using the event would just complicate things without any benefits.
--
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-20635 Cleanup code wrt IGNITE-18733 mentions [ignite-3]
Posted by "tkalkirill (via GitHub)" <gi...@apache.org>.
tkalkirill commented on code in PR #2686:
URL: https://github.com/apache/ignite-3/pull/2686#discussion_r1357942407
##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgniteNodeRestartTest.java:
##########
@@ -1230,15 +1231,31 @@ private void createTableWithData(List<IgniteImpl> nodes, String name, int replic
}
}
- private void waitForIndex(Collection<IgniteImpl> nodes, String indexName) throws InterruptedException {
- // FIXME: Wait for the index to be created on all nodes,
- // this is a workaround for https://issues.apache.org/jira/browse/IGNITE-18733 to avoid missed updates to the PK index.
- assertTrue(waitForCondition(
- () -> nodes.stream()
- .map(nodeImpl -> nodeImpl.catalogManager().index(indexName.toUpperCase(), nodeImpl.clock().nowLong()))
- .allMatch(Objects::nonNull),
- TIMEOUT_MILLIS
- ));
+ private void waitForIndexToBecomeAvailable(Collection<IgniteImpl> nodes, String indexName) throws InterruptedException {
+ CountDownLatch latch = new CountDownLatch(nodes.size());
+
+ nodes.forEach(node -> node.catalogManager().listen(CatalogEvent.INDEX_AVAILABLE, (event, ex) -> {
+ if (ex != null) {
+ return failedFuture(ex);
+ }
+
+ MakeIndexAvailableEventParameters availableEvent = (MakeIndexAvailableEventParameters) event;
+
+ CatalogIndexDescriptor index = node.catalogManager().index(availableEvent.indexId(), HybridTimestamp.MAX_VALUE.longValue());
Review Comment:
```suggestion
CatalogIndexDescriptor index = node.catalogManager().index(availableEvent.indexId(), event.catalogVersion());
```
--
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