Le Wednesday 12 November 2008 16:39:00 Jason Dixon, vous avez écrit : > On Wed, Nov 12, 2008 at 07:07:13AM -0800, Dan Langille wrote: > > On Nov 11, 2008, at 2:32 PM, Jason Dixon wrote: > >> We have a new Bacula server (2.4.2 on Solaris 10 x86) that runs fine for > >> most backup jobs. However, we've encountered a particular job that > >> hangs indefinitely with the status "Dir inserting attributes". It's > >> important to note that all of our other jobs complete successfully > >> except this one. > > > > What others have said confirmed what I thought. I too think this job > > is not hanging. It is inserting. > > For two days? This isn't a slow box. Here is the pg_stat_activity we > gathered yesterday. According to our DBA, it was deadlocked as > exhibited by pids 6192 and 21732 both having ExclusiveLock's. > > http://pastebin.com/f26d96438 > > Thanks,
I'd first like to expain one thing : PostgreSQL (like most RDBMS) has a deadlock detection algorithm. So if you really had a deadlock, you'd know : one of the deadlocked processes would be killed. On to your problem : Nothing in the pastebin shows a locked process. To have this information, first, we need the waiting column from pg_stats_activity. As long as it is false, the session has all its locks granted. If the colum is 'true' for a statement, then we can dig into pg_locks, but for this, we'll need more columns too (at least the granted column, to know if the lock is granted or not), but all columns of pg_locks is better (it tells on what the lock is, who's waiting for who, etc ...). It seems to me that the most plausible explanation isn't a lock problem (the whole thing is designed so that inserts into file doesn't lock), but a tuning problem : - are the statistics up to date ? (and are you vacuuming regularly. I hope so, but I'd rather ask) - are shared_buffers and work_mem big enough (how much memory do you have ?). This query is supposed to do hash or merge joins between batch, path and filename, which are quite large tables. If it decided to do a nested loop, for 15 million rows, it would be catastrophic ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users