Issue #3044: B-Tree Index

Type: Bug ReoprtVersion: 2.9.0_04Priority: NormalStatus: FixedReplies: 5
#1

Hi Devs,

is @Embeddable B-Tree-Index always limited to INTEGER_MAX?

thx

#2

Could you please clarify your question with a bit more detail?

  • Are you referring to the maximum number of entries supported in the index?
  • Are you encountering an exception when exceeding a specific limit?

If you're seeing an error, sharing the exact error message and stack trace would help us figure out what's happening.

ObjectDB Support
#3

1. schema

import javax.persistence.EmbeddedId;
import javax.persistence.Entity;

@Entity
public class Value {

    @EmbeddedId
    public ValueId id;

    public int c;
    public double v;

    public Value() { }

}

import javax.persistence.Embeddable;

@Embeddable
public class ValueId {

    public int p;
    public int d;
    public int h;

    public ValueId() { }

}

2.1 values count <= Integer.MAX_VALUE: writing OK, reading OK

2.2 values count > Integer.MAX_VALUE: writing OK, reading frozen (no exceptions)

3. ObjectDB-Doctor:

.................................................. 52000MB
..................... 52042MB (total) Analyzing database structure...
10% 20% 30% 40% 50% 60% 70% 80% 90% 100%

BTree Value Errors: [1] package...Value

  - Unexpected object count: -2144921860 (actual 2150045436)

 

#4

Thank you for this report. Please try build 2.9.5_02, which should solve this issue.

ObjectDB Support
#5

Thank you for solving this issue!

I guess:

1. root, 100%: B-Tree-Index > Integer.MAX_VALUE. What's new max?

2. leaf, 0%: Exception at Write or Read - problem persists.

So 1., what's the best strategy to move all *.odb from 2.9.0_04 to 2.9.5_02 and to be shure it's save?

Tool (like doctor) or just maven.version?

Note: Production databases are well below Integer.MAX_VALUE. The migration from 2.9.0_04 to 2.9.5_02 would take place without overflow.

thx

#6

The new theoretical maximum should be Long.MAX_VALUE, but you will hit another limit earlier, the size of the database: maximum Integer.MAX_VALUE pages (page = 2048 bytes by default, and can be increased up to 64K).

You can switch to the new version with any valid database. However, if the database file is already corrupted due to the bug in the older version, you should first repair it using the Doctor of the new version.

ObjectDB Support

Reply