Re: Urgent assistance with locking behaviour of existdb - or how to change the architecture of a scheduled ETL service
Willem van der Westhuizen <[email protected]> Sat, 18 Oct 2025 12:54:24 +0200
| Newsgroups | gmane.text.xml.exist |
|---|---|
| Organization | Kwantu Infomrmation Technology |
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format. --===============4683387530987216421== Content-Type: multipart/alternative; boundary="------------plnH0yBWjOZ62zPMvVBHtsAw" Content-Language: en-US This is a multi-part message in MIME format. --------------plnH0yBWjOZ62zPMvVBHtsAw Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi, The etl engine is an existdb module, that is called by an xquery. One hypothesis is that each time that the xquery runs, it loads an instance of the module into memory, and thats is where the locking happens. No way to tell if that is indeed the case, and what the internal limiations are. The one interesting observation is that even in older version 3.3.3 if the xquery is pending up due to the remote service being called is stalled, then the number of instances in exists always stop responding at around 160 plus or minus, then the whole exist instance locks up. The number of database brokers, and memory etc. was never a limit. In the later versions of exist the deadlock may occur at much lover levels. To give an example, we have rewritten most of the critical code that locked up in javascript, and there was no issue in the downstream services. The explanation offered of recursive calling of modules might be a clue, because that is certainly the case in our code. We would prefer to keep the ETL in exist though, hence trying to find a solution. Regards Willem On 2025/10/18 11:38, Claudius Teodorescu wrote: > Hi! > > Would it help to have the ETL engine as an eXist-db module? > > > Claudius Teodorescu > > On Sat, 18 Oct 2025 at 11:29, Willem van der Westhuizen > <[email protected]> wrote: > > Maybe there is a different question to ask. We are using exist and > xquery extensively with an etl engine that we wrote to read data from > couchdb and place into MySQL for reporting purposes. We are currently > using a shell script to launch 20 instances of the the etl with > different parameters to pick up a batch and process it. Would > there be a > better way in exist to write the scheduler to make those calls, > and then > to wait for each instance to be complete before calling the next, > that > would not involve calling the same rest service muliple times from > curl? > > Regards > > Willem > > On 2025/10/15 11:48, Willem van der Westhuizen wrote: > > Definitely not updating. Just running, > > > > On 2025/10/15 10:30, Juri Leino wrote: > >> Hi Willem! > >> > >> The behaviour you are describing is usually a sign for an > attempt to > >> replace/update a running XQuery. If this is the case the easiest > >> solution is to make sure that the query you want to replace / > change > >> is not being run at the moment. > >> > >> I agree that we should investigate if we even have to lock the > XQuery > >> in the first place. But that is a separate discussion. > >> > >> Regards, > >> Juri > >> > >> On 12.10.25 13:01, Willem van der Westhuizen wrote: > >>> Hi > >>> > >>> We use existdb extensively to run xqueries on our external > >>> databases, couchdb and others. We dont use the existdb > datastore for > >>> our data. > >>> > >>> We used to run on an old 3.3.3 version of existdb, and recently > >>> migrated to 6.2. Since then we have found that existdb locks the > >>> xquery that is being executed, causing deadlocks that eventually > >>> locks up the server. Is there an easy way to tell existdb to > revert > >>> to the older locking behaviour that does not lock up the xquery > >>> being run? > >>> > >>> > >>> Regards > >>> > >> > >> > >> _______________________________________________ > >> Exist-open mailing list > >> [email protected] > >> https://lists.sourceforge.net/lists/listinfo/exist-open > > > > > > _______________________________________________ > > Exist-open mailing list > > [email protected] > > https://lists.sourceforge.net/lists/listinfo/exist-open > > > _______________________________________________ > Exist-open mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/exist-open > > > > -- > Cu stimă, > Claudius Teodorescu --------------plnH0yBWjOZ62zPMvVBHtsAw Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> <p>Hi,</p> <p>The etl engine is an existdb module, that is called by an xquery. One hypothesis is that each time that the xquery runs, it loads an instance of the module into memory, and thats is where the locking happens. No way to tell if that is indeed the case, and what the internal limiations are.</p> <p>The one interesting observation is that even in older version 3.3.3 if the xquery is pending up due to the remote service being called is stalled, then the number of instances in exists always stop responding at around 160 plus or minus, then the whole exist instance locks up. The number of database brokers, and memory etc. was never a limit.</p> <p>In the later versions of exist the deadlock may occur at much lover levels. To give an example, we have rewritten most of the critical code that locked up in javascript, and there was no issue in the downstream services. <br> </p> <p>The explanation offered of recursive calling of modules might be a clue, because that is certainly the case in our code. We would prefer to keep the ETL in exist though, hence trying to find a solution.</p> <p>Regards</p> <p>Willem<br> </p> <div class="moz-cite-prefix">On 2025/10/18 11:38, Claudius Teodorescu wrote:<br> </div> <blockquote type="cite" cite="mid:CAPTZ0VwkU--8cFGi22xxTP5nKN660X7AKQAsQoenj7XovTK8Jw@mail.gmail.com"> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <div dir="ltr"> <div>Hi!</div> <div><br> </div> <div>Would it help to have the ETL engine as an eXist-db module?</div> <div><br> </div> <div><br> </div> <div>Claudius Teodorescu</div> </div> <br> <div class="gmail_quote gmail_quote_container"> <div dir="ltr" class="gmail_attr">On Sat, 18 Oct 2025 at 11:29, Willem van der Westhuizen <<a href="mailto:[email protected]" moz-do-not-send="true" class="moz-txt-link-freetext">[email protected]</a>> wrote:<br> </div> <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Maybe there is a different question to ask. We are using exist and <br> xquery extensively with an etl engine that we wrote to read data from <br> couchdb and place into MySQL for reporting purposes. We are currently <br> using a shell script to launch 20 instances of the the etl with <br> different parameters to pick up a batch and process it. Would there be a <br> better way in exist to write the scheduler to make those calls, and then <br> to wait for each instance to be complete before calling the next, that <br> would not involve calling the same rest service muliple times from curl?<br> <br> Regards<br> <br> Willem<br> <br> On 2025/10/15 11:48, Willem van der Westhuizen wrote:<br> > Definitely not updating. Just running,<br> ><br> > On 2025/10/15 10:30, Juri Leino wrote:<br> >> Hi Willem!<br> >><br> >> The behaviour you are describing is usually a sign for an attempt to <br> >> replace/update a running XQuery. If this is the case the easiest <br> >> solution is to make sure that the query you want to replace / change <br> >> is not being run at the moment.<br> >><br> >> I agree that we should investigate if we even have to lock the XQuery <br> >> in the first place. But that is a separate discussion.<br> >><br> >> Regards,<br> >> Juri<br> >><br> >> On 12.10.25 13:01, Willem van der Westhuizen wrote:<br> >>> Hi<br> >>><br> >>> We use existdb extensively to run xqueries on our external <br> >>> databases, couchdb and others. We dont use the existdb datastore for <br> >>> our data.<br> >>><br> >>> We used to run on an old 3.3.3 version of existdb, and recently <br> >>> migrated to 6.2. Since then we have found that existdb locks the <br> >>> xquery that is being executed, causing deadlocks that eventually <br> >>> locks up the server. Is there an easy way to tell existdb to revert <br> >>> to the older locking behaviour that does not lock up the xquery <br> >>> being run?<br> >>><br> >>><br> >>> Regards<br> >>><br> >><br> >><br> >> _______________________________________________<br> >> Exist-open mailing list<br> >> <a href="mailto:[email protected]" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">[email protected]</a><br> >> <a href="https://lists.sourceforge.net/lists/listinfo/exist-open" rel="noreferrer" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">https://lists.sourceforge.net/lists/listinfo/exist-open</a><br> ><br> ><br> > _______________________________________________<br> > Exist-open mailing list<br> > <a href="mailto:[email protected]" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">[email protected]</a><br> > <a href="https://lists.sourceforge.net/lists/listinfo/exist-open" rel="noreferrer" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">https://lists.sourceforge.net/lists/listinfo/exist-open</a><br> <br> <br> _______________________________________________<br> Exist-open mailing list<br> <a href="mailto:[email protected]" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">[email protected]</a><br> <a href="https://lists.sourceforge.net/lists/listinfo/exist-open" rel="noreferrer" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">https://lists.sourceforge.net/lists/listinfo/exist-open</a><br> </blockquote> </div> <div><br clear="all"> </div> <br> <span class="gmail_signature_prefix">-- </span><br> <div dir="ltr" class="gmail_signature"> <div dir="ltr"> <div> <div dir="ltr"> <div>Cu stimă,</div> Claudius Teodorescu</div> </div> </div> </div> </blockquote> </body> </html> --------------plnH0yBWjOZ62zPMvVBHtsAw-- --===============4683387530987216421== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============4683387530987216421== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Exist-open mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/exist-open --===============4683387530987216421==--