-
-
Couldn't load subscription status.
- Fork 79
Additional test #2593
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
Additional test #2593
Conversation
Summary of ChangesHello @robfrank, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly advances the stability of ArcadeDB's composite indexing by addressing a critical bug related to DELETE and CREATE operations within the same transaction. It also provides a thorough, multi-document analysis of another high-severity bug concerning index updates where a field is reverted to a previous value, outlining root causes, hypotheses, and future investigation steps. The changes include core logic enhancements in the transaction index context and the addition of comprehensive test cases and documentation to support ongoing debugging and verification efforts. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request adds comprehensive documentation and several new tests related to composite index bugs. The analysis provided in the markdown files is thorough and valuable for understanding the issues. However, there are a few points to address. The core logic changes in TransactionIndexContext.java, which are detailed in the pull request description, appear to be missing from the provided file changes. This makes a complete review of the fix impossible. Additionally, some of the new tests are named as 'Debug' tests and include assertions that will always fail, suggesting they are not ready for merging. There is also an unrelated file, Issue2497Demo.java, which should ideally be moved to a separate pull request to keep this one focused. Please see the specific comments for more details.
| assertThat(true).isTrue(); | ||
| } else { | ||
| System.out.println("NOT FOUND! Bug confirmed."); | ||
| assertThat(false).as("Should find the PENDING record").isTrue(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| values.remove(entry); // Remove the REMOVE operation | ||
| // v stays as ADD | ||
| } else { | ||
| // REPLACE EXISTENT WITH THIS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
|
||
| ## Files Modified | ||
|
|
||
| 1. `/Users/frank/projects/arcade/arcadedb/engine/src/main/java/com/arcadedb/database/TransactionIndexContext.java` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file path is an absolute local path. For portability and to avoid leaking user-specific information, it should be relative to the repository root. This also applies to other absolute paths in this file, such as on line 242.
| 1. `/Users/frank/projects/arcade/arcadedb/engine/src/main/java/com/arcadedb/database/TransactionIndexContext.java` | |
| 1. `engine/src/main/java/com/arcadedb/database/TransactionIndexContext.java` |
| ## Root Cause Analysis | ||
|
|
||
| ### Location | ||
| **File**: `/Users/frank/projects/arcade/arcadedb/engine/src/main/java/com/arcadedb/database/TransactionIndexContext.java` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file path is an absolute local path. It should be relative to the repository root to be useful for all contributors. This also applies to other absolute paths in this file, such as on lines 245 and 246.
| **File**: `/Users/frank/projects/arcade/arcadedb/engine/src/main/java/com/arcadedb/database/TransactionIndexContext.java` | |
| **File**: `engine/src/main/java/com/arcadedb/database/TransactionIndexContext.java` |
engine/src/test/java/com/arcadedb/query/sql/executor/DebugUpdateIndexTest.java
Show resolved
Hide resolved
| * Demonstration class for Issue #2497 - JSON empty array serialization fix. | ||
| * This class shows the before/after behavior of Object[] array serialization. | ||
| */ | ||
| public class Issue2497Demo { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file Issue2497Demo.java appears to be a demonstration for a JSON serialization issue (#2497), which seems unrelated to the main focus of this pull request on composite index bugs. To maintain a clean and focused commit history, it would be better to move this file and its related changes to a separate pull request.
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
This pull request adds comprehensive documentation and analysis regarding composite index bugs, their root causes, and the fixes or ongoing work in ArcadeDB. The main focus is on two classes of issues: (1) handling DELETE + CREATE operations with the same composite key in a single transaction, and (2) correctly updating composite indexes when a field is changed and then reverted to its original value across transactions. The documentation details root causes, solution strategies, implementation details, and test results.
Composite Index Bug Analysis and Fix Documentation:
DELETE + CREATE in Same Transaction (Issue #2590, FIXED):
2590-composite-index-analysis.md) explaining how the transaction context previously lost track of deleted RIDs when a REMOVE operation was overwritten by REPLACE, leading to uniqueness validation failures and DuplicatedKeyExceptions. The implemented fix introduces a separatedeletedEntriesmap inTransactionIndexContext.javato track deleted RIDs independently, ensuring correct validation and passing all related tests. [1] [2]UPDATE to Original Value Across Transactions (PARTIAL, Ongoing):
COMPOSITE_INDEX_REPLACE_BUG_ANALYSIS.md) of a bug where updating an indexed field back to a previous value causes the index to lose the entry, making the record invisible to index-based queries. The analysis identifies that the transaction context correctly tracks operations, but the underlying LSM tree index may mishandle tombstones (deletion markers) and REPLACE operations, leading to the bug. Several fix options and next steps are outlined, with ongoing investigation into LSM tree behavior. [1] [2]Codebase and Test Changes:
TransactionIndexContext Enhancements:
deletedEntriesandremovedRidsPerIndexmaps to track deleted RIDs and removed RIDs per index, respectively, inTransactionIndexContext.java. EnhancedaddIndexKeyLock()logic for correct operation conversion and added extensive debugging/logging. [1] [2]Testing and Documentation:
SimpleUpdateIndexTest.java,UPDATE_INDEX_BUG_ANALYSIS.md,COMPOSITE_INDEX_UPDATE_STATUS.md) to track status, test results, and ongoing debugging efforts. [1] [2]Summary of Most Important Changes:
Documentation and Analysis:
2590-composite-index-analysis.mdandCOMPOSITE_INDEX_REPLACE_BUG_ANALYSIS.mdfor in-depth root cause analysis, solution design, and implementation details for composite index bugs. [1] [2]COMPOSITE_INDEX_UPDATE_STATUS.mdto track progress, test results, and next steps for composite index fixes.Codebase Enhancements:
TransactionIndexContext.javawith new fields and logic to preserve deleted RID information and correctly handle ADD→REPLACE operation conversions for unique composite indexes