checkSelfStatus() starts the promises branch at the slot position instead of the promised sequence, so recovery ranges are wrong
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- java
- Domain
- databases, distributed-systems
Research direction
Read core/src/main/java/com/orientechnologies/orient/core/transaction/OTransactionSequenceManager.java around checkSelfStatus() and the existing sequenceMissingPromised test in core/src/test/java/.../OTransactionSequenceManagerTest.java. Compare the promise branch’s loop start with the no-promise path, then add exact expected-range cases where the slot position differs from the promised sequence. Run the focused sequence manager tests; done means all four reported ranges match the expected sets.
Written by the indexing model from the issue text.
Description
OrientDB Version: 3.2.55 (build 5a42e4f47183a1db1fa00186bd817dda57e24eeb)
Java Version: OpenJDK 1.8.0_492 (jdk8u492-b09)
OS: Linux x86_64 (official orientdb:latest image, Docker)
Expected behavior
OTransactionSequenceManager.checkSelfStatus() should return exactly the transaction ids that are missing locally relative to the remote sequence status. When a slot has an outstanding promise, the scan should start after the promised sequence (promise.getSequence() + 1), not at the slot index.
For the four bounded states below, the expected missing sets are:
| Local slot state | Remote status | Expected missing | Actual |
|---|---|---|---|
slot 5 applied 1–3, promise 5:4 |
5:6 |
[5:4, 5:5, 5:6] |
[5:6] |
slot 2 promise 2:1 |
2:5 |
[2:2, 2:3, 2:4, 2:5] |
[2:3, 2:4, 2:5] |
slot 2 applied 1–10, promise 2:11 |
2:13 |
[2:12, 2:13] |
[2:3 … 2:13] (11 entries) |
slot 2 applied 1–3, promise 2:4 |
2:6 |
[2:5, 2:6] |
[2:3, 2:4, 2:5, 2:6] |
The no-promise control path returns the correct range in each case.
Actual behavior
The promise branch starts the loop at this.promisedSequential[i].getId().getPosition() + 1. getPosition() is the slot index, not the transaction sequence. This produces both under-reporting (slot 5 / promise 5:4 → starts at 6, dropping 5:4 and 5:5) and over-reporting (slot 2 / promise 2:11 → starts at 3, asking for already-applied 2:3 … 2:10). The result is passed to OrientDBDistributed.receivePing() → requestTransactions(), so catch-up either skips missing transactions or requests bogus historical ones.
Steps to reproduce
This is a bounded Java-level reproduction of the current source logic; no multi-node cluster is needed to observe the range calculation.
- Start the container (for the current-source class compilation and readiness/liveness evidence):
docker run -d --name orient-seq -p 127.0.0.1:32480:2480 \
-e ORIENTDB_ROOT_PASSWORD=auditpass orientdb:latest
- Compile a small harness against the current
OTransactionSequenceManager(the audit PoCs copy the current source classes into the container and compile them withjavac):
OTransactionSequenceManager manager = new OTransactionSequenceManager(8, ...);
manager.nextAt(5); // promise 5:4 (or 2:11 in the second case)
OTransactionSequenceStatus remote = new OTransactionSequenceStatus(new long[]{0,0,0,0,0,6,0,0});
System.out.println(manager.checkSelfStatus(remote)); // actual [5:6]
- Compare the actual list with the expected sets in the table; repeat for the other three states.
Observed outputs: [5:6], [2:3,2:4,2:5], [2:3 … 2:13], [2:3,2:4,2:5,2:6]; the corresponding no-promise controls match the expected sets.
Additional context
core/src/main/java/com/orientechnologies/orient/core/transaction/OTransactionSequenceManager.java:159-160— in the promise branch:
for (long x = this.promisedSequential[i].getId().getPosition() + 1; x <= status[i]; x++) {
missing.add(new OTransactionId(i, x));
}
- The correct lower bound is
this.promisedSequential[i].getId().getSequence() + 1;getPosition()is the slot index, which only equals the sequence by coincidence in the simplest test data. distributed/src/main/java/com/orientechnologies/orient/distributed/db/OrientDBDistributed.java:1658-1661—receivePing()passes this list torequestTransactions().core/src/test/java/.../OTransactionSequenceManagerTest.java:67-71— the existingsequenceMissingPromisedtest only checks that the list contains missing items/size; it does not pin the exact range when position and promised sequence differ.
I re-checked current develop on 2026-11-17: the promise branch still uses getPosition() + 1 (line 173 in the current file).
Suggested fix: use getSequence() + 1 as the lower bound in the promise branch, and add exact-oracle tests for (a) position < sequence, (b) position > sequence, (c) already-applied sequences above the position. The four cases above can serve as regression cases.
Scope note: this is a method-level reproduction compiled from the current source, not a multi-node end-to-end recovery; the container provides the Java environment and version/liveness evidence. The stock 3.2.55 runtime jar does not contain the current-source package name, so the PoC compiles the current source class rather than calling the packaged one.
- Dominant language
- Java
- Stars
- 5k
- Forks
- 871
- Avg merge
- 17h 38m
- Merged PRs (30d)
- 40
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from orientechnologies/orientdb
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
orientechnologies/orientdb#11015 ·
Maintainers usually reply within 1 day
-
Finalized promises remain in promisedById, so isPromised() keeps returning true and the map leaksOpen
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
orientechnologies/orientdb#11012 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
orientechnologies/orientdb#11011 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
orientechnologies/orientdb#11010 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
orientechnologies/orientdb#10999 ·
Maintainers usually reply within 1 day
All issues in orientechnologies/orientdb
Similar issues
-
needs-format
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Niko1221/Strata#6475 · 1 comment ·
Maintainers usually reply within 6 days
-
Difficulty 1/5 1-3 hours Newbie friendliness 74/100
zeweihan/aiworkdeck#1643 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
DIGI-UW/OpenELIS-Global-2#5149 ·
Maintainers usually reply within 1 day
-
Duplicate arrowOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
SilentChaos512/Silent-Gear#1009 ·
-
Clean up leftover IDE files and stale .gitignore entriesPossibly taken @aberenguel claimed this today. Open
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
sepinf-inc/IPED#3097 ·
Maintainers usually reply within 5 days