Skip to content
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

Repair database --fix-links throw a java.lang.StackOverflowError #8897

Closed
cschockaert opened this issue Jun 6, 2019 · 9 comments
Closed
Assignees

Comments

@cschockaert
Copy link

OrientDB Version: 3.0.19

Java Version: openjdk version "1.8.0_212"

OpenJDK Runtime Environment (IcedTea 3.12.0) (Alpine 8.212.04-r0)
OpenJDK 64-Bit Server VM (build 25.212-b04, mixed mode)

OS: docker running on mac os high sierra

Expected behavior

repair database --fix-links should not return any error on a empty new created database

Actual behavior

orientdb {db=test}> repair database --fix-links
Error: java.lang.StackOverflowError

Steps to reproduce

docker run --rm -it orientdb:3.0.19 /orientdb/bin/console.sh

OrientDB console v.3.0.19 - Veloce (build a3fdf7219c73b544bb40b52a9a5fbe9349433945, branch 3.0.x) https://www.orientdb.com
Type 'help' to display all the supported commands.
orientdb> sh: tput: not found
orientdb> create database plocal:/tmp/test

Creating database [plocal:/tmp/test] using the storage type [PLOCAL]...
Database created successfully.

Current database is: plocal:/tmp/test
orientdb {db=test}> check database;

Checking storage.Check of storage is started...Check of storage completed in 195ms.  without errors.
Checking indexes.
Checking cluster ofunction  for index OFunction.name
cluster ofunction (6) |********************| 100%
Total errors found on indexes: 0
orientdb {db=test}> repair database --fix-graphs
Repair of graph 'plocal:/tmp/test' is started ...
Scanning 0 edges (skipEdges=0)...
Scanning edges completed
Scanning 0 vertices...
Scanning vertices completed
Repair of graph 'plocal:/tmp/test' completed in 0 secs
 scannedEdges.....: 0
 removedEdges.....: 0
 scannedVertices..: 0
 scannedLinks.....: 0
 removedLinks.....: 0
 repairedVertices.: 0

orientdb {db=test}> repair database --fix-links

Error: java.lang.StackOverflowError

orientdb {db=test}> exit
@cschockaert
Copy link
Author

cschockaert commented Jun 6, 2019

Working fine in orientdb 2.2.37

cschockaert@cschockaert.local:~$ docker run --rm -it orientdb:2.2.37 /orientdb/bin/console.sh

OrientDB console v.2.2.37 (build a7541e7ceeabf592dd9a7b2928b6c023cbc73193, branch 2.2.x) https://www.orientdb.com
Type 'help' to display all the supported commands.
Installing extensions for GREMLIN language v.2.6.0

orientdb> sh: tput: not found
orientdb> create database plocal:/tmp/test

Creating database [plocal:/tmp/test] using the storage type [plocal]...
Database created successfully.

Current database is: plocal:/tmp/test
orientdb {db=test}> repair database --fix-links

Repairing database...
- Removing broken links...
-- Done! Fixed links: 0, modified documents: 0
Repair database complete (0 errors)
orientdb {db=test}>

@cschockaert
Copy link
Author

working fine in 3.0.0:

cschockaert@cschockaert.local:~$ docker run --rm -it orientdb:3.0.0 /orientdb/bin/console.sh
Unable to find image 'orientdb:3.0.0' locally
3.0.0: Pulling from library/orientdb
ff3a5c916c92: Already exists
5de5f69f42d7: Pull complete
fd869c8b9b59: Pull complete
4313db097501: Pull complete
9bd2b9ebe825: Pull complete
Digest: sha256:c21008df21d855b7f26f6b38ea33f5d6d171af8e55f885fd45ecaef3cc3025d8
Status: Downloaded newer image for orientdb:3.0.0

OrientDB console v.3.0.0 - Veloce (build 099033f72305d1c17f27d025b04afad7059c1298, branch develop) https://www.orientdb.com
Type 'help' to display all the supported commands.
orientdb> sh: tput: not found
orientdb> create database plocal:/tmp/test

Creating database [plocal:/tmp/test] using the storage type [PLOCAL]...
Database created successfully.

Current database is: plocal:/tmp/test
orientdb {db=test}> repair database --fix-links

Repairing database...
- Removing broken links...
-- Done! Fixed links: 0, modified documents: 0
Repair database complete (0 errors)
orientdb {db=test}>

@cschockaert
Copy link
Author

working fine in 3.0.10

@cschockaert
Copy link
Author

seems that this commit introduced the bug :

8b4e258

@luigidellaquila

@cschockaert
Copy link
Author

public void repairDatabase(
      @ConsoleParameter(name = "options", description = "Options: [--fix-graph] [--force-embedded-ridbags] [--fix-links] [-v]] [--fix-ridbags] [--fix-bonsai]", optional = true) String iOptions)
      throws IOException {
   ...
    final boolean fix_links = iOptions == null || iOptions.contains("--fix-links");
    if (fix_links) {
      // REPAIR DATABASE AT LOW LEVEL
      repairDatabase(iOptions);
    }

  ...
  }

@cschockaert
Copy link
Author

current method is calling himself if options contains --fix-links

@luigidellaquila
Copy link
Member

Hi @cschockaert

I see, it's obviously wrong, I'll fix it ASAP

Thanks

Luigi

@luigidellaquila luigidellaquila self-assigned this Jun 6, 2019
luigidellaquila added a commit that referenced this issue Jun 7, 2019
@luigidellaquila
Copy link
Member

Hi @cschockaert

I just pushed a fix, it will be released with v 3.0.21.

The fix will be in next snapshot in a few minutes

Thanks

Luigi

@cschockaert
Copy link
Author

Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants