apache / apache/jena

DSGSetup.setupTDB failing with TDB2 on partial compact

Open
#3,431 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
1.4k
Forks
712
Avg merge
15h 41m
Merged PRs (30d)
53

Description

### Version

5.3.0

### What happened?

DSGSetup.setupTDB is failing when starting a TDB2 instance with a partial compact.

When calling TDBOps.isTDB2, it will call org.apache.jena.tdb2.sys.DatabaseOps.findStorageLocation, which checks for a storage location without partial compact.

Cleanup is only handled when creating the DB connection: https://github.com/apache/jena/blob/jena-5.5.0/jena-tdb2/src/main/java/org/apache/jena/tdb2/sys/DatabaseOps.java#L129

### Steps to reproduce:

- Start a fuseki instance with TDB2 backend
- Start a compact
- Kill the fuseki instance while the compact is happening
- Start again the fuseki instance, which will fail.

### Relevant output and stacktrace

```shell
org.apache.jena.dboe.DBOpEnvException: Invalid filename for matching: Data-0002-tmp
at org.apache.jena.tdb2.sys.DatabaseOps.scanForDirByPattern(DatabaseOps.java:534)
at org.apache.jena.tdb2.sys.DatabaseOps.findStorageLocation(DatabaseOps.java:588)
at org.apache.jena.tdb2.sys.DatabaseOps.findStorageLocation(DatabaseOps.java:577)
at org.apache.jena.fuseki.system.spot.SpotTDB2.storageDir(SpotTDB2.java:118)
at org.apache.jena.fuseki.system.spot.SpotTDB2.isTDB2(SpotTDB2.java:77)
at org.apache.jena.fuseki.system.spot.SpotTDB2.isTDB2(SpotTDB2.java:60)
at org.apache.jena.fuseki.system.spot.TDBOps.isTDB2(TDBOps.java:46)
at org.apache.jena.fuseki.main.cmds.DSGSetup.setupTDB(DSGSetup.java:84)
at org.apache.jena.fuseki.main.cmds.FusekiMain.lambda$processStdArguments$5(FusekiMain.java:457)
at org.apache.jena.fuseki.main.cmds.FusekiMain.applyServerArgs(FusekiMain.java:735)
at org.apache.jena.fuseki.main.cmds.FusekiMain.makeServer(FusekiMain.java:679)
at org.apache.jena.fuseki.main.cmds.FusekiMain.execMakeServer(FusekiMain.java:641)
at org.apache.jena.fuseki.main.cmds.FusekiMain.exec(FusekiMain.java:635)
at org.apache.jena.cmd.CmdMain.mainMethod(CmdMain.java:86)
at org.apache.jena.cmd.CmdMain.mainRun(CmdMain.java:55)
at org.apache.jena.cmd.CmdMain.mainRun(CmdMain.java:43)
at org.apache.jena.fuseki.main.cmds.FusekiMain.run(FusekiMain.java:159)
at org.apache.jena.fuseki.mod.FusekiServerRunner.main(FusekiServerRunner.java:45)
at org.apache.jena.fuseki.main.cmds.FusekiServerCmd.main(FusekiServerCmd.java:48)
```

### Are you interested in making a pull request?

No

Contributor guide

Open the contributing guide

Research direction

Start at FusekiMain's DSGSetup.setupTDB and follow TDBOps.isTDB2 into SpotTDB2 and DatabaseOps.findStorageLocation, especially scanForDirByPattern and the cleanup referenced in DatabaseOps.java. Reproduce a restart after killing Fuseki during a TDB2 partial compact, then verify that startup no longer fails on the temporary storage directory.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.