Share single FormatChecksumStrategy instance per shard between engine and store - #21232
Conversation
PR Reviewer Guide 🔍(Review updated until commit a8dc95f)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to a8dc95f Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit 72b7b35
Suggestions up to commit 72b7b35
Suggestions up to commit 72b7b35
Suggestions up to commit ed59d73
Suggestions up to commit ed59d73
|
|
❌ Gradle check result for b94ced6: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
Persistent review updated to latest commit 76721fc |
|
❌ Gradle check result for 76721fc: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
76721fc to
97671e1
Compare
|
Persistent review updated to latest commit 97671e1 |
97671e1 to
69fd004
Compare
|
Persistent review updated to latest commit 69fd004 |
|
Persistent review updated to latest commit 24f399b |
24f399b to
15280e0
Compare
|
Persistent review updated to latest commit 15280e0 |
|
❌ Gradle check result for 15280e0: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
15280e0 to
9e8491b
Compare
|
Persistent review updated to latest commit 9e8491b |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #21232 +/- ##
============================================
+ Coverage 73.45% 73.47% +0.02%
- Complexity 74315 74341 +26
============================================
Files 5961 5961
Lines 337610 337623 +13
Branches 48704 48706 +2
============================================
+ Hits 247985 248072 +87
+ Misses 69832 69755 -77
- Partials 19793 19796 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Persistent review updated to latest commit f56754b |
|
Persistent review updated to latest commit ed59d73 |
|
❌ Gradle check result for ed59d73: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
Persistent review updated to latest commit ed59d73 |
Signed-off-by: Kamal Nayan <askkamal@amazon.com>
|
Persistent review updated to latest commit 72b7b35 |
|
❌ Gradle check result for 72b7b35: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
Persistent review updated to latest commit 72b7b35 |
|
❌ Gradle check result for 72b7b35: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
Persistent review updated to latest commit 72b7b35 |
…nitialization Signed-off-by: Kamal Nayan <askkamal@amazon.com>
|
Persistent review updated to latest commit a8dc95f |
… and store (opensearch-project#21232) * Share single FormatChecksumStrategy instance per shard, between engine and directory Signed-off-by: Kamal Nayan <askkamal@amazon.com> * Minor refactoring Signed-off-by: Kamal Nayan <askkamal@amazon.com> * Added Tests for checkum strategy sharing Signed-off-by: Kamal Nayan <askkamal@amazon.com> * Add checksum read-back assertion to shared strategy test Signed-off-by: Kamal Nayan <askkamal@amazon.com> * Fix indexingEngine call in CompositeIndexingExecutionEngineTests for updated API Signed-off-by: Kamal Nayan <askkamal@amazon.com> * Fix compilation after rebase with upstream Lucene engine plugin Signed-off-by: Kamal Nayan <askkamal@amazon.com> * Updated DataFormatRegistry tests to increase test coverage Signed-off-by: Kamal Nayan <askkamal@amazon.com> * updated the code to use supplier for DataFormatDescriptors for lazy initialization Signed-off-by: Kamal Nayan <askkamal@amazon.com> --------- Signed-off-by: Kamal Nayan <askkamal@amazon.com> Co-authored-by: Kamal Nayan <askkamal@amazon.com>
Description
ParquetDataFormatPlugin.getFormatDescriptors() creates a new PrecomputedChecksumStrategy() on every call. Since the directory and engine call it independently, they end up with different instances. Also DataFormatPlugin.lastDescriptors where getting updated as new Shards are created as these are node level singleton class. Checksums registered by the engine during writes are invisible to the directory during uploads, forcing an O(n) full-file CRC32 fallback instead of O(1) lookup.
Fix:
Create strategies once per shard in IndexService.createShard() via DataFormatRegistry.createChecksumStrategies() and pass the same map to both DataFormatAwareStoreDirectory and IndexingEngineConfig.
Changes
Testing