SourceForge.net Logo
Main Overview Wiki Issues Forum Build Fisheye

Welcome, Guest
Guest Settings
Help

Compass Support Forums » Compass » Compass Users

Thread: Deadlock when using MS SQL Server

This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 9 - Pages: 1 - Last Post: Dec 3, 2011 4:02 AM Last Post By: woolrich
staticsnow

Posts: 8
Registered: 6/11/08
Deadlock when using MS SQL Server
Posted: Oct 15, 2008 1:32 PM
 
  Click to reply to this thread Reply
I seem to get a deadlock in compass when using MS SQL server and JDBCDirectory when two threads attempt to update the same index simultaneously. I looked into the root cause, and it seems that DefaultLuceneSearchEngineIndexManager.openIndexHolderBySubIndex is causing the problem. Somewhere in the bowels of the shouldInvalidateCache method, it seems the IndexReader uses the Directory to try to acquire a write lock, while the indexHoldersLocks lock is held. Another thread already holds the database lock, and is blocked on the java indexHoldersLocks lock, and so a deadlock occurs. I have modified the code in this method locally as follows to move the shouldInvalidateCache method to be invoked outside of a synchronized block, and the error goes away:

public LuceneIndexHolder openIndexHolderBySubIndex(String subIndex) throws SearchEngineException {

try {
LuceneIndexHolder indexHolder = null;
synchronized (indexHoldersLocks.get(subIndex)) {
indexHolder = indexHolders.get(subIndex);
}
if (shouldInvalidateCache(indexHolder)) {
synchronized (indexHoldersLocks.get(subIndex)) {
indexHolder = internalRefreshCache(subIndex);
}
}
indexHolder.acquire();
return indexHolder;
} catch (Exception e) {
throw new SearchEngineException("Failed to open index searcher for sub-index ", e);
}

}

Sorry I haven't been more specific, I modified this code a few months ago and haven't gotten around to posting this until now. I necessary I can put the code back and try to reproduce again and provide more details. Does this seem like a reasonable change?

pangea

Posts: 368
Registered: 9/25/07
Re: Deadlock when using MS SQL Server
Posted: Oct 15, 2008 1:52 PM   in response to: staticsnow in response to: staticsnow
 
  Click to reply to this thread Reply
As far as my understanding goes, the INDEX should not be UPDATED by multiple threads at the same time...all dirty operations need to be serialized (if performed on the same index).
staticsnow

Posts: 8
Registered: 6/11/08
Re: Deadlock when using MS SQL Server
Posted: Oct 15, 2008 2:11 PM   in response to: staticsnow in response to: staticsnow
 
  Click to reply to this thread Reply
I know that only one thread can actually be physically writing the index at one time, but it was my understanding that Compass would synchronize this internally using it's write locks and transactions, not require me to serialize my writes myself. Is this not the case? It seems like there is lots of code in Compass that tries to make sure only one write is happening simultaneously.
Shay Banon

Posts: 4,028
Registered: 9/6/05
Re: Deadlock when using MS SQL Server
Posted: Oct 16, 2008 2:40 PM   in response to: staticsnow in response to: staticsnow
 
  Click to reply to this thread Reply
Compass uses Lucene mechanism for obtaining write locks before doing dirty operations on a sub index. It is implemented on top of the database by default using phantom read locks. If two threads try to update the index concurrently, then the first one will obtain the write lock, and the other one will wait for the write lock to be released, otherwise, it should time out.
louisvuittonbox

Posts: 411
Registered: 8/23/11
Re: Deadlock when using MS SQL Server
Posted: Aug 23, 2011 10:47 PM   in response to: staticsnow in response to: staticsnow
 
  Click to reply to this thread Reply
Looking for a new ghd lisseur? Now, you can make your hair to be curl or straight with styler ghd, which is a suitable styling tool, you are able to use it to change your hairstyle which you like in a entirely very less period of time. This useful product was created and designed by the Farouk Systems, and today lisser ghd are loved by more and more young girls and graceful ladies. There are many ghd hair straighteners around the whole world nowadays, and GHD Outlet online store may be the best choice for you, if you want to buy discount Ghd IV salon styler.As a professional ghd France online seller, we provide Ghd Iv Styler,Ghd Iv Salon Styler,Ghd Iv,Ghd Salon Styler,ghd iv mini styler,ghd straighteners sale,ghd gold styler and so on at lower price, you can find different designs, colors of GHD IV Styler are listed in our livraison gratuite. When you find your ideal GHD IV Styler, you can order them soon, and we will send our products to you witnin a week, no tax sale, fast free shipping. Hope you enjoy your shopping here.
pylxwzhj

Posts: 719
Registered: 10/15/11
Re: Deadlock when using MS SQL Server
Posted: Nov 9, 2011 2:41 AM   in response to: staticsnow in response to: staticsnow
 
  Click to reply to this thread Reply
Despite the anger

Coach Outlet

at Washington, voters

Chanel Bags

did not appear to be in a throw-the-bums-out frame

Coach Outlet

of mind at the city and state levels.

Coach Outlet

In Philadelphia, Mayor Michael Nutter,

Coach Outlet

a Democrat, won re-election, as did Mayor Greg Ballard,

LV Outlet

a Republican, in Indianapolis

Louis Vuitton

and Mayor Stephanie Rawlings-Blake,

Coach Outlet

a Democrat, in Baltimore. In Phoenix,

Chanel Handbags

Greg Stanton, a Democrat, was

Coach Factory Store

the winner while in San Francisco, Edwin M. Lee, the interim mayor,
pylxwzhj

Posts: 719
Registered: 10/15/11
Re: Deadlock when using MS SQL Server
Posted: Nov 26, 2011 3:48 AM   in response to: staticsnow in response to: staticsnow
 
  Click to reply to this thread Reply
The generals, meanwhile,

Coach Outlet

issued an unusual apology for the

Chanel Handbags

deaths of at least 38 people

Coach Outlet

during the week of unrest

Chanel Bags

and the injuries of more than 2,000.

Coach Factory Outlet

But even as they hailed the dead

Coach Outlet Online

as “martyrs,” the generals also appeared

Coach Outlet

to justify killing them as criminals

Coach Outlet

who had attacked the Interior Ministry.

Coach Outlet Online

And they denied — despite the statements

Louis Vuitton Bags

of many witnesses, doctors and

Coach Factory Outlet

even the health ministry — that security

Louis Vuitton Bags

forces had fired live ammunition or birdshot in

Coach Outlet

their clashes with protesters, further inflaming anger.
hogan280

Posts: 180
Registered: 12/3/11
Hogan
Posted: Dec 3, 2011 1:30 AM   in response to: staticsnow in response to: staticsnow
 
  Click to reply to this thread Reply
riscaldatore seduto accanto any credited grandi uomini, mother quando low haya visto l . a . stessa cosa, mother low c'è da meravigliarsi, my partner and i credited grandi uomini, una penna any mano, una pila di documenti prima di loro, not possesso di not giornale, anche schierati sul tavolinodi fronte any una mappa, my partner and i bambini low è venuto inside pace every trovare l . a . initial. Queshi Bi Yuan Ning ancora 's cello superiore photographic camera da letto giù more quickly. hogan 5 laggiù insieme any Ning Yuan Ruhuasiyu appear una donna giovane, il suo volto sembra prendere sempre not sorriso malizioso, low è l . a . madre si è donne elizabeth L . a . signorina Li Ying Dong Lida chi altro
longchamp

Posts: 272
Registered: 12/1/11
Longchamp
Posted: Dec 3, 2011 3:44 AM   in response to: staticsnow in response to: staticsnow
 
  Click to reply to this thread Reply
longchamp, il se révèle être and also vital de l'histoire des graphic designers français de cuir, bagages et maroquinerie Longchamp strain devenir l'un des meilleurs quartiers de la marque, et devenir united nations symbole de la haute société. Aujourd'hui, la marque your not seulement la perception limitée de Longchamp et de vendre des reports sac longchamp durante cuir haut de gamme et des bagages, mais à s'impliquer dans la style, accessoires, chaussures, sacs, bijoux, montres, des médias, du vin et d'autres régions du géant des indicateurs de tendance.www.sacslongchamp-france.org
woolrich

Posts: 142
Registered: 12/3/11
Re: Deadlock when using MS SQL Server
Posted: Dec 3, 2011 4:02 AM   in response to: staticsnow in response to: staticsnow
 
  Click to reply to this thread Reply
L . a . storia di Woolrich,Creata nel 1952 any Grenoble, inside Francia da René Ramillon, il marchio woolrich è tratto da not piccolo villaggio chiamato Monastier de Clermont vicino any Grenoble. Nel corso degli anni giubbotto Woolrich è cresciuto significativamente, appear not marchio di abbigliamento quality che offre capi eleganti elizabeth confortevoli every gli uomini elizabeth le donne.
Legend
Guru: 2001 + pts
Expert: 501 - 2000 pts
Super-star: 101 - 500 pts
Assistant: 51 - 100 pts
Participant: 0 - 50 pts
Helpful Answer (5 pts)
Correct Answer (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums