You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "ibessonov (via GitHub)" <gi...@apache.org> on 2025/04/25 13:54:30 UTC
[PR] IGNITE-25212 Fix getting empty values from meta-storage in some cases [ignite-3]
ibessonov opened a new pull request, #5698:
URL: https://github.com/apache/ignite-3/pull/5698
https://issues.apache.org/jira/browse/IGNITE-25212
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-25212 Fix getting CompactedException from meta-storage in some cases [ignite-3]
Posted by "rpuch (via GitHub)" <gi...@apache.org>.
rpuch commented on code in PR #5698:
URL: https://github.com/apache/ignite-3/pull/5698#discussion_r2063368191
##########
modules/metastorage/src/test/java/org/apache/ignite/internal/metastorage/server/AbstractCompactionKeyValueStorageTest.java:
##########
@@ -526,6 +526,55 @@ void testDoNotDeleteOnExactMatchCompaction() {
assertEquals(entryBefore, entryAfter);
}
+ @Test
+ void testReadCompactedTombstoneConcurrent() {
+ KeyValueUpdateContext context = kvContext(hybridTimestamp(10L));
+
+ byte[] extraKey = key(-1);
+ byte[] extraValue = keyValue(0, 0);
+
+ for (int i = 0; i < 1000; i++) {
+ byte[] key = key(i);
+ byte[] value = keyValue(i, i);
+
+ storage.put(key, value, context);
+ storage.remove(key, context);
+
+ long revision = storage.revision();
+
+ // Increase revision, so that compaction on "revision" can safely be executed.
+ storage.put(extraKey, extraValue, context);
+
+ runRace(
+ () -> {
+ storage.setCompactionRevision(revision);
+ storage.compact(revision);
+ },
+ () -> {
+ // We update the same value in order to cause a race in "writeBatch" method, that would leave already compacted
+ // revisions in a list of revisions associated with this key.
+ storage.put(key, value, context);
+ }
+ );
+
+ // Not a real assertion. It's for a developer that reads this test. Yes, you.
+ assertEquals(revision + 2, storage.revision());
+
+ long nextToLast = storage.revision() - 1;
+
+ // Here we read the previous value of the key that's been inserted right now.
+ // WatchProcessor does exactly the same thing, and it must work, otherwise Ignite nodes will fail in "remove+put" scenarios.
+ Entry entry = storage.get(key, nextToLast);
Review Comment:
Is it true that this is the central line of the test scenario, and we expect that nothing will explode here? If yes, it makes sense to wrap it in `assertDoesNotThrow()` and maybe additionally say in the comment that this IS the real assertion :)
--
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-25212 Fix getting CompactedException from meta-storage in some cases [ignite-3]
Posted by "ibessonov (via GitHub)" <gi...@apache.org>.
ibessonov merged PR #5698:
URL: https://github.com/apache/ignite-3/pull/5698
--
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