-
Notifications
You must be signed in to change notification settings - Fork 721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix the CacheUniqueID #7772
Fix the CacheUniqueID #7772
Conversation
3e387c0
to
61a9ccf
Compare
d5971f3
to
95b1d6e
Compare
59416b9
to
d1acb2d
Compare
Hi @pshipton , I have fixed the CacheUniqueID by adding more information at the end. The only issue I have is: On the ppc64_aix, if I use the option For now, I have removed the timestamp and used the filesize , metadatabytes, classesbytes, linenumbertablebytes and variabletablebytes as the cacheuniqueID. Do you think we need more fields on the cacheuniqueID? Could you please give me some advice? Thank you! |
We can add a creation date/time to the OSCache_header2 structure, there is some reserved room, and use that as part of the cacheuniqueID. |
There is an issue #7710 about moving the cache from one machine to another. Not sure whether the create time will be changed if it is moved. |
Hi @pshipton , to add the creation time, instead of using the Do you have any other suggestion? Thanks! |
You can use the current time/date when the cache is created, like omrtime_hires_clock(), it's not required to use st_mtime or st_ctime. This becomes part of the unique ID for the cache, it doesn't matter if the cache is moved to another machine. It gives a value which is fairly unique for every cache. The other values (filesize , metadatabytes, classesbytes, linenumbertablebytes and variabletablebytes) will capture changes to the cache. Together they provide a unique ID which is unlikely to be duplicated by another cache. |
I think omrtime_nano_time() is better than omrtime_hires_clock(), as I think hires_clock() can be affected by the boot time of the machine, so may repeat. |
Sorry, I mean omrtime_current_time_nanos(). |
Thank you for the explanation! I will make this change. |
974b1e2
to
1f5c9b3
Compare
Tests have passed on ppc64_aix, ppc64le_linux, x86-64_linux, x86-64_mac (JDK 8) @hangshao0 , could you please review it? Thank you! |
Please stop rebasing before force pushing. Github will show me your changes if you push just your changes. If you need to rebase, please push it separately. |
jenkins compile win32 jdk8 |
29d457b
to
1b8796d
Compare
I have made the change and resolved the conflict. |
I believe when this is merged, we can remove
From https://eclipse.github.io/openj9-docs-staging/385/xshareclasses/#layer and https://eclipse.github.io/openj9-docs-staging/385/xshareclasses/#createlayer |
jenkins test sanity,extended win jdk8 |
Not sure I agree, let's discuss it in person. |
testSCCacheManagement_win_0 is failing |
I'm taking a look at this, it's a new function which is added in #7955. |
Looks like it is caused by my change. |
Found in the tracepoint;
Looks like the cache unique ID starts with
I guess there are 2 \ in the cacheDirName after "javasharedresources" but only one in the unique ID, making the file name incorrect (290M4F1A64P_cache3_multilayercache_G41L00 missing "C" at the begining). Then we fail to acquire write lock on a non-existing cache file:
"ache3" should be "cache3" here. |
Can you change SH_OSCache::getCacheNameAndLayerFromUnqiueID() to be more robust without relying on the size of passed in cacheDirName ? @doomerxe |
Hi @pshipton , I have made the changes, could you please re-run the test? I will squash the commits after it passes. Thank you! |
1215e13
to
2c9d09f
Compare
The second parameter should be ctrlDirName instead of cacheDirName. |
jenkins test sanity,extended win jdk8 |
@hangshao0 can you please review the changes before they are squashed. |
Except the NLS sample inputs, the rest looks good to me. |
Hi @pshipton , may I squash the commits now? Thanks! |
@doomerxe yes, please go ahead and squash |
1. Add the creation time to the OSCache_header2 2. Fix the CacheUniqueID by adding creation time, metadatabytes, classesbytes, linenumbertablebytes and variabletablebytes at the end 3. Add new Trace Events j9shr.2326-2329 for the CacheUniqueID Signed-off-by: Jiahan Xi <doomerXe@gmail.com>
97866a5
to
18e59a6
Compare
Fixes #8096
Signed-off-by: Jiahan Xi doomerXe@gmail.com