You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2022/04/17 01:36:32 UTC
[GitHub] [ignite] liyuj opened a new pull request, #9983: IGNITE-16866: Integer value is out of bounds when the dataregion maxS…
liyuj opened a new pull request, #9983:
URL: https://github.com/apache/ignite/pull/9983
…ize is large enough
Thank you for submitting the pull request to the Apache Ignite.
In order to streamline the review of the contribution
we ask you to ensure the following steps have been taken:
### The Contribution Checklist
- [ ] 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 pull request body describes changes that have been made.
The description explains _WHAT_ and _WHY_ was made instead of _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.
- [ ] A reviewer has been mentioned through the JIRA comments
(see [the Maintainers list](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute#HowtoContribute-ReviewProcessandMaintainers))
- [ ] The pull request has been checked by the Teamcity Bot and
the `green visa` attached to the JIRA ticket (see [TC.Bot: Check PR](https://mtcga.gridgain.com/prs.html))
### Notes
- [How to Contribute](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute)
- [Coding abbreviation rules](https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules)
- [Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines)
- [Apache Ignite Teamcity Bot](https://cwiki.apache.org/confluence/display/IGNITE/Apache+Ignite+Teamcity+Bot)
If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com _#ignite_ channel.
--
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
[GitHub] [ignite] liyuj commented on pull request #9983: IGNITE-16866: Integer value is out of bounds when the dataregion maxS…
Posted by GitBox <gi...@apache.org>.
liyuj commented on PR #9983:
URL: https://github.com/apache/ignite/pull/9983#issuecomment-1100972514
Thanks for your review, all your suggestions have been fixed.
在 2022/4/17 23:57, Nikita Amelchev 写道:
>
> ***@***.**** commented on this pull request.
>
> ------------------------------------------------------------------------
>
> In
> modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/evict/Random2LruPageEvictionTracker.java
> <https://github.com/apache/ignite/pull/9983#discussion_r851774318>:
>
> > @@ -69,7 +69,7 @@ public Random2LruPageEvictionTracker(
>
> /** ***@***.***} */
> @Override public void start() throws IgniteException {
> - trackingArrPtr = GridUnsafe.allocateMemory(trackingSize * 8);
> + trackingArrPtr = GridUnsafe.allocateMemory((long)trackingSize * 8);
>
> A long constant can be used instead of casting for better readability:
> |8L|, |4L|
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/apache/ignite/pull/9983#pullrequestreview-943963281>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ACGRBATG7Z4KFLP2RQUTLPDVFQYGFANCNFSM5TTEREJQ>.
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
--
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
[GitHub] [ignite] NSAmelchev commented on pull request #9983: IGNITE-16866: Integer value is out of bounds when the dataregion maxS…
Posted by GitBox <gi...@apache.org>.
NSAmelchev commented on PR #9983:
URL: https://github.com/apache/ignite/pull/9983#issuecomment-1100856891
@liyuj, Hi! Thanks for the PR.
Could you add a reproducer?
Something like a test in the `CacheDataRegionConfigurationTest` class:
```
/** @throws Exception If failed. */
@Test
public void testLargeRegionsWithEviction() throws Exception {
DataRegionConfiguration cfg1 = new DataRegionConfiguration()
.setName("region-1")
.setMaxSize(4 * 1024 * U.GB)
.setPageEvictionMode(DataPageEvictionMode.RANDOM_LRU);
DataRegionConfiguration cfg2 = new DataRegionConfiguration()
.setName("region-2")
.setMaxSize(4 * 1024 * U.GB)
.setPageEvictionMode(DataPageEvictionMode.RANDOM_2_LRU);
memCfg = new DataStorageConfiguration().setDataRegionConfigurations(cfg1, cfg2);
startGrid();
}
```
And then please get a visa from the CI bot. See [How to Contribute](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute).
--
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
[GitHub] [ignite] liyuj commented on pull request #9983: IGNITE-16866: Integer value is out of bounds when the dataregion maxS…
Posted by GitBox <gi...@apache.org>.
liyuj commented on PR #9983:
URL: https://github.com/apache/ignite/pull/9983#issuecomment-1100877327
I checked the latest codebase and didn't find the test cases you mentioned(testLargeRegionsWithEviction() in CacheDataRegionConfigurationTest).
--
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
[GitHub] [ignite] NSAmelchev commented on a diff in pull request #9983: IGNITE-16866: Integer value is out of bounds when the dataregion maxS…
Posted by GitBox <gi...@apache.org>.
NSAmelchev commented on code in PR #9983:
URL: https://github.com/apache/ignite/pull/9983#discussion_r851774318
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/evict/Random2LruPageEvictionTracker.java:
##########
@@ -69,7 +69,7 @@ public Random2LruPageEvictionTracker(
/** {@inheritDoc} */
@Override public void start() throws IgniteException {
- trackingArrPtr = GridUnsafe.allocateMemory(trackingSize * 8);
+ trackingArrPtr = GridUnsafe.allocateMemory((long)trackingSize * 8);
Review Comment:
A long constant can be used instead of casting for better readability: `8L`, `4L`
--
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
[GitHub] [ignite] NSAmelchev merged pull request #9983: IGNITE-16866: Integer value is out of bounds when the dataregion maxS…
Posted by GitBox <gi...@apache.org>.
NSAmelchev merged PR #9983:
URL: https://github.com/apache/ignite/pull/9983
--
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
[GitHub] [ignite] liyuj commented on pull request #9983: IGNITE-16866: Integer value is out of bounds when the dataregion maxS…
Posted by GitBox <gi...@apache.org>.
liyuj commented on PR #9983:
URL: https://github.com/apache/ignite/pull/9983#issuecomment-1100875041
public class IgniteServer {
public static void main(String[] args) {
IgniteConfiguration cfg = new IgniteConfiguration();
DataStorageConfiguration storageCfg = new DataStorageConfiguration();
DataRegionConfiguration defaultRegion = new DataRegionConfiguration();
defaultRegion.setMaxSize(4 * 1024 * U.GB);
defaultRegion.setPageEvictionMode(DataPageEvictionMode.RANDOM_2_LRU);
storageCfg.setDefaultDataRegionConfiguration(defaultRegion);
cfg.setDataStorageConfiguration(storageCfg);
Ignition.start(cfg);
}
}
above is the reproducer.
--
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
[GitHub] [ignite] NSAmelchev commented on pull request #9983: IGNITE-16866: Integer value is out of bounds when the dataregion maxS…
Posted by GitBox <gi...@apache.org>.
NSAmelchev commented on PR #9983:
URL: https://github.com/apache/ignite/pull/9983#issuecomment-1100904481
@liyuj Just add suggested test to this test class in your pull request. Run test and make sure the issue was fixed. Seems, we need explicit cast in a subsequent lines after memory allocate:
`GridUnsafe.setMemory(..., int -> long, ...)`
--
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