temp table problem due to thread concurrency ( ERROR: could not open file "base/ ) ?

From: "Jan-Peter Seifert" <Jan-Peter(dot)Seifert(at)gmx(dot)de>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: temp table problem due to thread concurrency ( ERROR: could not open file "base/ ) ?
Date: 2014-05-07 15:45:21
Message-ID: trinity-7399eb94-5d8b-4135-9b99-8fcb8e85a6ee-1399477521298@3capp-gmx-bs08
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div class="signature">Hello,</div>

<div class="signature">&nbsp;</div>

<div class="signature">a &#39;bulk loading&#39; routine using temporary tables suddenly failed during tests for no obvious reasons. At some point one of the updates on the temporary table fails with the error message &quot;ERROR:&nbsp; could not open file &quot;base/...&quot;.</div>

<div class="signature">&nbsp;</div>

<div class="signature">-Execute is used for executing the statements.</div>

<div class="signature">-Autocommit mode is used because of possible large load size.</div>

<div class="signature">-At the beginning of a load script another script drops all temporary tables - using a select on pg_tables for getting the table names.</div>

<div class="signature">-Then &#39;normal&#39; temporary tables (with no &#39;ON COMMIT DROP&#39;) with a fixed name are created and filled via insert first - followed by several updates. One of those updates fails.</div>

<div class="signature">&nbsp;</div>

<div class="signature">An strace revealed that another process dropped the temporary table in question before the failing update - most likely the drop script. This also happens when in the same transaction. Additionally we used ON COMMIT DROP and DISCARD TEMP and DISCARD PLANS instead of dropping all temporary tables. However, DISCARD TEMP obviously blocks the INSERT when within a transaction.</div>

<div class="signature">&nbsp;</div>

<div class="signature">Removing the drop script and dropping the temporary tables created at the beginning of the load at the end seems to help or am I mistaken?</div>

<div class="signature">&nbsp;</div>

<div class="signature">So is every &#39;JDBC&#39; execute using its own thread/process? If so is there a way to force them to execute in succession and not in parallel/concurrently?</div>

<div class="signature">&nbsp;</div>

<div class="signature">Could you tell me, please?</div>

<div class="signature">&nbsp;</div>

<div class="signature">Thank you very much!</div>

<div class="signature">&nbsp;</div>

<div class="signature">Best wishes,</div>

<div class="signature">&nbsp;</div>

<div class="signature">Peter</div>

<div class="signature">&nbsp;</div>

<div class="signature">&nbsp;</div>

<div class="signature">&nbsp;</div>

<div class="signature">&nbsp;</div>

<div class="signature">&nbsp;</div></div></body></html>

Attachment Content-Type Size
unknown_filename text/html 2.4 KB

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message David G Johnston 2014-05-07 18:13:56 Re: temp table problem due to thread concurrency ( ERROR: could not open file "base/ ) ?
Previous Message Kevin Grittner 2014-05-05 13:54:57 Re: TR: [BUGS] BUG #8842: lo_open/fastpath transaction inconsistency