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

Database backup leads to index failures #10224

Open
jacquipre opened this issue May 3, 2024 · 1 comment
Open

Database backup leads to index failures #10224

jacquipre opened this issue May 3, 2024 · 1 comment
Labels
Milestone

Comments

@jacquipre
Copy link

OrientDB Version: 3.2.22

Java Version: 17.0.10

OS: Windows

Expected behavior

Database backup does not corrupt indices.

Actual behavior

When making a backup via

try (ODatabaseDocumentTx db = // acquire database from pool ) {
            OCommandOutputListener listener = // logs somethings

            try (OutputStream out = new FileOutputStream(path)) {
                db.backup(out, null, null, listener, 1, 2048);
            }
}

sometimes an exception is thrown:

SEVERE: Exception `1CE43CF2` in storage `plocal:/data/database`: 3.2.22 (build ${buildNumber}, branch UNKNOWN)
java.lang.NullPointerException: Cannot invoke "com.orientechnologies.orient.core.record.impl.ODocument.containsField(String)" because "metadata" is null
        at com.orientechnologies.lucene.engine.OLuceneDirectoryFactory.createDirectory(OLuceneDirectoryFactory.java:31)
        at com.orientechnologies.lucene.engine.OLuceneIndexEngineAbstract.open(OLuceneIndexEngineAbstract.java:249)
        at com.orientechnologies.lucene.engine.OLuceneIndexEngineAbstract.reOpen(OLuceneIndexEngineAbstract.java:236)
        at com.orientechnologies.lucene.engine.OLuceneIndexEngineAbstract.release(OLuceneIndexEngineAbstract.java:665)
        at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.release(OAbstractPaginatedStorage.java:4192)
        at com.orientechnologies.orient.core.storage.disk.OLocalPaginatedStorage.backup(OLocalPaginatedStorage.java:289)
        at com.orientechnologies.orient.core.db.document.ODatabaseDocumentEmbedded.backup(ODatabaseDocumentEmbedded.java:1912)
        at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.backup(ODatabaseDocumentTx.java:1326)

Not sure why this happened.

It leads to a removal of all database and lucene (only RAM type) indizes in the index manager. When loading the database, I can see that no index is found anymore, although all index files are currently available in the database directory.

Do you have any ideas what can lead to such a database behaviour? How can we fix the database? Is there a possibility?

I saw an issue about same errors: #8813

What was the resolution here?

Regards, j.

@jacquipre
Copy link
Author

Hi, I found out that there is a lucene index (type: RAM) registered in the indexEngines List of OAbstractPaginatedStorage which is marked as closed and has metadata = null. When requesting this index via the OIndexManager with getClassIndexes(String indexName) this index does not exist.

We are making a backup of the database every night at the same time. I guess, this index gets "corrupted" while freezing those Lucene indexes in com.orientechnologies.orient.core.storage.disk.OLocalPaginatedStorage#backup (Line 244 calls freeze(...))
Here those indices were closed.
When the backup is done, this index is not released (unfreezed) anymore.

Is there any possibility to get rid of this corrupted index? I tried dropping it or even call deleteIndexEngine(indexId) but this all leads to the same error?

@tglman tglman added this to the 3.2.x milestone May 18, 2024
@tglman tglman added the bug label May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants