I’ll check out the snapshot.
I was starting to dig into the Java code yesterday but was first testing if I needed the optimization at all in this case, which it looks like I don’t (the consumer of the stored docs doesn’t depend on indexing to find things).
Cheers,
E.
_____________________________________________ Eliot Kimber Sr Staff Content Engineer O: 512 554 9368 M: 512 554 9368 servicenow.comhttps://www.servicenow.com LinkedInhttps://www.linkedin.com/company/servicenow | Twitterhttps://twitter.com/servicenow | YouTubehttps://www.youtube.com/user/servicenowinc | Facebookhttps://www.facebook.com/servicenow
From: Christian Grün christian.gruen@gmail.com Date: Wednesday, February 28, 2024 at 9:36 AM To: Eliot Kimber eliot.kimber@servicenow.com Cc: basex-talk@mailman.uni-konstanz.de basex-talk@mailman.uni-konstanz.de Subject: Re: [basex-talk] Optimize database never returns, leaves database in "opened by another process" state [External Email]
________________________________ …this one could be related to a bug that was recently fixed in the latest snapshot [1]. About time to get BaseX 11 finished…[1] https://github.com/BaseXdb/basex/commit/45d97f8065615fb734b712bc4c77c39899e9... Mon, Feb 26, 2024 at 5:25 PM Eliot Kimber <eliot.kimber@servicenow
i This message needs your attention • Someone new is on this email. Provided by ServiceNow DT (Employee Portal KB0077950) - This banner is visible only to ServiceNow employees.https://mimecast.com …this one could be related to a bug that was recently fixed in the latest snapshot [1]. About time to get BaseX 11 finished…
[1] https://github.com/BaseXdb/basex/commit/45d97f8065615fb734b712bc4c77c39899e9...
On Mon, Feb 26, 2024 at 5:25 PM Eliot Kimber <eliot.kimber@servicenow.commailto:eliot.kimber@servicenow.com> wrote: Using Basex 10.7 on Linux.
I’m running a sequence of jobs to update and optimize a set of databases following loading a number of documents created dynamically (as opposed to being read from disk).
I’m seeing a new behavior, which is that the optimization step never completes but also doesn’t show any error in the log. The database shows no items and is in the locked by another process state if I try to drop it. This behavior seems to be consistently repeatable with my current code base (I’m working on some code updates, so it’s possible I’ve introduced something that would cause this behavior but I haven’t changed the code that leads up to the failing optimize). The server has plenty of disk space, etc.
Optimization code is:
try { if (db:exists($database)) then ( util:logToConsole('dbadmin:optimizeDatabase', ``[Optimizing database `{$database}`]``), db:optimize($database, true(), $dbadmin:dbOptimizeOptions) ) else util:logToConsole('dbadmin:optimizeDatabase', ``[Database '`{$database}`' does not exist. Nothing to optimize.]``) } catch * { util:logToConsole( 'dbadmin:optimizeDatabase', ``[Exception optimizing database '`{$database}`': `{$err:code}` - `{$err:description}`]``, 'error') }
And the optimization options are:
declare variable $dbadmin:dbOptimizeOptions as map(*) := (: Turn on all the indexes :) map { 'attrindex' : true(), 'tokenindex' : true(), 'textindex' : true(), 'ftindex' : true() };
This code has been working fine for a long time and I’ve been running 10.7 for a least a couple of months, so I’m wondering:
A) Would would cause this behavior? B) How can I diagnose it short of debugging the Java code (which I can do but it’s non-trivial for me to set up).
Thanks,
Eliot
_____________________________________________ Eliot Kimber Sr Staff Content Engineer O: 512 554 9368 M: 512 554 9368 servicenow.comhttps://www.servicenow.com LinkedInhttps://www.linkedin.com/company/servicenow | Twitterhttps://twitter.com/servicenow | YouTubehttps://www.youtube.com/user/servicenowinc | Facebookhttps://www.facebook.com/servicenow