Use retry logic and real file system in file settings ITs#116392
Use retry logic and real file system in file settings ITs#116392elasticsearchmachine merged 9 commits intoelastic:mainfrom
Conversation
|
@elasticmachine update branch |
|
@elasticmachine update branch |
|
@elasticmachine update branch |
|
Pinging @elastic/es-core-infra (Team:Core/Infra) |
ldematte
left a comment
There was a problem hiding this comment.
Looks good, but if you want to put some more work in it an clean it up a bit more I left a suggestion. Optional, up to you.
Thanks!
| Files.move(tempFilePath, fileSettingsService.watchedFile(), StandardCopyOption.ATOMIC_MOVE); | ||
| logger.info("--> After writing new settings file: [{}]", settingsFileContent); | ||
| logger.info("--> before writing JSON config to node {} with path {}", node, tempFilePath); | ||
| logger.info(Strings.format(json, version)); |
There was a problem hiding this comment.
Nit: maybe extract Strings.format(json, version) to a variable like in the original code?
| } | ||
|
|
||
| private static void writeJSONFile(String node, String json, Logger logger, AtomicLong versionCounter, boolean incrementVersion) | ||
| public static void writeJSONFile(String node, String json, Logger logger, AtomicLong versionCounter, boolean incrementVersion) |
There was a problem hiding this comment.
Nit: why did this become public?
There was a problem hiding this comment.
It's re-used by another test. However, I like your suggestion below to just move it to ESIntegTestCase which makes this bit obsolete.
...ty/src/internalClusterTest/java/org/elasticsearch/integration/RoleMappingFileSettingsIT.java
Show resolved
Hide resolved
…lasticsearch into generalize-file-settings-it-fix
💔 Backport failedThe backport operation could not be completed due to the following error: You can use sqren/backport to manually backport by running |
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
…6392) Several file-settings ITs fail (rarely) with exceptions like: ``` java.nio.file.AccessDeniedException: C:\Users\jenkins\workspace\platform-support\14\server\build\testrun\internalClusterTest\temp\org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT_5733F2A737542BE-001\tempFile-001.tmp -> C:\Users\jenkins\workspace\platform-support\14\server\build\testrun\internalClusterTest\temp\org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT_5733F2A737542BE-001\tempDir-002\config\operator\settings.json | at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89) | -- | -- | | at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) | | | at sun.nio.fs.WindowsFileCopy.move(WindowsFileCopy.java:317) | | | at sun.nio.fs.WindowsFileSystemProvider.move(WindowsFileSystemProvider.java:293) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at java.nio.file.Files.move(Files.java:1430) | | | at org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT.writeJSONFile(SnaphotsAndFileSettingsIT.java:86) | | | at org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT.testRestoreWithPersistedFileSettings(SnaphotsAndFileSettingsIT.java:321) ``` This happens in Windows file systems, due to a race condition where the file settings service is reading the settings file concurrently with the test trying to modify it (a no-go in Windows). It turns out we have already addressed this with a retry for one test suite (elastic#91863), plus addressed a related issue around mock windows file-systems misbehaving (elastic#92653). This PR extends the above fixes to all file-settings related ITs. (cherry picked from commit 91559da)
…6392) Several file-settings ITs fail (rarely) with exceptions like: ``` java.nio.file.AccessDeniedException: C:\Users\jenkins\workspace\platform-support\14\server\build\testrun\internalClusterTest\temp\org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT_5733F2A737542BE-001\tempFile-001.tmp -> C:\Users\jenkins\workspace\platform-support\14\server\build\testrun\internalClusterTest\temp\org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT_5733F2A737542BE-001\tempDir-002\config\operator\settings.json | at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89) | -- | -- | | at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) | | | at sun.nio.fs.WindowsFileCopy.move(WindowsFileCopy.java:317) | | | at sun.nio.fs.WindowsFileSystemProvider.move(WindowsFileSystemProvider.java:293) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at java.nio.file.Files.move(Files.java:1430) | | | at org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT.writeJSONFile(SnaphotsAndFileSettingsIT.java:86) | | | at org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT.testRestoreWithPersistedFileSettings(SnaphotsAndFileSettingsIT.java:321) ``` This happens in Windows file systems, due to a race condition where the file settings service is reading the settings file concurrently with the test trying to modify it (a no-go in Windows). It turns out we have already addressed this with a retry for one test suite (elastic#91863), plus addressed a related issue around mock windows file-systems misbehaving (elastic#92653). This PR extends the above fixes to all file-settings related ITs. (cherry picked from commit 91559da)
Several file-settings ITs fail (rarely) with exceptions like: ``` java.nio.file.AccessDeniedException: C:\Users\jenkins\workspace\platform-support\14\server\build\testrun\internalClusterTest\temp\org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT_5733F2A737542BE-001\tempFile-001.tmp -> C:\Users\jenkins\workspace\platform-support\14\server\build\testrun\internalClusterTest\temp\org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT_5733F2A737542BE-001\tempDir-002\config\operator\settings.json | at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89) | -- | -- | | at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) | | | at sun.nio.fs.WindowsFileCopy.move(WindowsFileCopy.java:317) | | | at sun.nio.fs.WindowsFileSystemProvider.move(WindowsFileSystemProvider.java:293) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at java.nio.file.Files.move(Files.java:1430) | | | at org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT.writeJSONFile(SnaphotsAndFileSettingsIT.java:86) | | | at org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT.testRestoreWithPersistedFileSettings(SnaphotsAndFileSettingsIT.java:321) ``` This happens in Windows file systems, due to a race condition where the file settings service is reading the settings file concurrently with the test trying to modify it (a no-go in Windows). It turns out we have already addressed this with a retry for one test suite (#91863), plus addressed a related issue around mock windows file-systems misbehaving (#92653). This PR extends the above fixes to all file-settings related ITs.
…116709) Several file-settings ITs fail (rarely) with exceptions like: ``` java.nio.file.AccessDeniedException: C:\Users\jenkins\workspace\platform-support\14\server\build\testrun\internalClusterTest\temp\org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT_5733F2A737542BE-001\tempFile-001.tmp -> C:\Users\jenkins\workspace\platform-support\14\server\build\testrun\internalClusterTest\temp\org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT_5733F2A737542BE-001\tempDir-002\config\operator\settings.json | at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89) | -- | -- | | at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) | | | at sun.nio.fs.WindowsFileCopy.move(WindowsFileCopy.java:317) | | | at sun.nio.fs.WindowsFileSystemProvider.move(WindowsFileSystemProvider.java:293) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at java.nio.file.Files.move(Files.java:1430) | | | at org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT.writeJSONFile(SnaphotsAndFileSettingsIT.java:86) | | | at org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT.testRestoreWithPersistedFileSettings(SnaphotsAndFileSettingsIT.java:321) ``` This happens in Windows file systems, due to a race condition where the file settings service is reading the settings file concurrently with the test trying to modify it (a no-go in Windows). It turns out we have already addressed this with a retry for one test suite (#91863), plus addressed a related issue around mock windows file-systems misbehaving (#92653). This PR extends the above fixes to all file-settings related ITs. (cherry picked from commit 91559da)
…116710) Several file-settings ITs fail (rarely) with exceptions like: ``` java.nio.file.AccessDeniedException: C:\Users\jenkins\workspace\platform-support\14\server\build\testrun\internalClusterTest\temp\org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT_5733F2A737542BE-001\tempFile-001.tmp -> C:\Users\jenkins\workspace\platform-support\14\server\build\testrun\internalClusterTest\temp\org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT_5733F2A737542BE-001\tempDir-002\config\operator\settings.json | at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89) | -- | -- | | at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) | | | at sun.nio.fs.WindowsFileCopy.move(WindowsFileCopy.java:317) | | | at sun.nio.fs.WindowsFileSystemProvider.move(WindowsFileSystemProvider.java:293) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at java.nio.file.Files.move(Files.java:1430) | | | at org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT.writeJSONFile(SnaphotsAndFileSettingsIT.java:86) | | | at org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT.testRestoreWithPersistedFileSettings(SnaphotsAndFileSettingsIT.java:321) ``` This happens in Windows file systems, due to a race condition where the file settings service is reading the settings file concurrently with the test trying to modify it (a no-go in Windows). It turns out we have already addressed this with a retry for one test suite (#91863), plus addressed a related issue around mock windows file-systems misbehaving (#92653). This PR extends the above fixes to all file-settings related ITs. (cherry picked from commit 91559da) Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
…6392) Several file-settings ITs fail (rarely) with exceptions like: ``` java.nio.file.AccessDeniedException: C:\Users\jenkins\workspace\platform-support\14\server\build\testrun\internalClusterTest\temp\org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT_5733F2A737542BE-001\tempFile-001.tmp -> C:\Users\jenkins\workspace\platform-support\14\server\build\testrun\internalClusterTest\temp\org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT_5733F2A737542BE-001\tempDir-002\config\operator\settings.json | at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89) | -- | -- | | at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) | | | at sun.nio.fs.WindowsFileCopy.move(WindowsFileCopy.java:317) | | | at sun.nio.fs.WindowsFileSystemProvider.move(WindowsFileSystemProvider.java:293) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at java.nio.file.Files.move(Files.java:1430) | | | at org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT.writeJSONFile(SnaphotsAndFileSettingsIT.java:86) | | | at org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT.testRestoreWithPersistedFileSettings(SnaphotsAndFileSettingsIT.java:321) ``` This happens in Windows file systems, due to a race condition where the file settings service is reading the settings file concurrently with the test trying to modify it (a no-go in Windows). It turns out we have already addressed this with a retry for one test suite (elastic#91863), plus addressed a related issue around mock windows file-systems misbehaving (elastic#92653). This PR extends the above fixes to all file-settings related ITs.
…6392) Several file-settings ITs fail (rarely) with exceptions like: ``` java.nio.file.AccessDeniedException: C:\Users\jenkins\workspace\platform-support\14\server\build\testrun\internalClusterTest\temp\org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT_5733F2A737542BE-001\tempFile-001.tmp -> C:\Users\jenkins\workspace\platform-support\14\server\build\testrun\internalClusterTest\temp\org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT_5733F2A737542BE-001\tempDir-002\config\operator\settings.json | at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89) | -- | -- | | at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) | | | at sun.nio.fs.WindowsFileCopy.move(WindowsFileCopy.java:317) | | | at sun.nio.fs.WindowsFileSystemProvider.move(WindowsFileSystemProvider.java:293) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at java.nio.file.Files.move(Files.java:1430) | | | at org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT.writeJSONFile(SnaphotsAndFileSettingsIT.java:86) | | | at org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT.testRestoreWithPersistedFileSettings(SnaphotsAndFileSettingsIT.java:321) ``` This happens in Windows file systems, due to a race condition where the file settings service is reading the settings file concurrently with the test trying to modify it (a no-go in Windows). It turns out we have already addressed this with a retry for one test suite (elastic#91863), plus addressed a related issue around mock windows file-systems misbehaving (elastic#92653). This PR extends the above fixes to all file-settings related ITs.
Several file-settings ITs fail (rarely) with exceptions like:
This happens in Windows file systems, due to a race condition where the file settings service is reading the settings file concurrently with the test trying to modify it (a no-go in Windows). It turns out we have already addressed this with a retry for one test suite (#91863), plus addressed a related issue around mock windows file-systems misbehaving (#92653).
This PR extends the above fixes to all file-settings related ITs.