Hi Mark,

Thanks for the suggestions!

I've forwarded this to infrastruct...@a.o... Some other responses below:

On Fri, Nov 27, 2009 at 12:49 AM, Mark Lassau <mlas...@atlassian.com> wrote:

> The root cause is most likely http://jira.atlassian.com/browse/JRA-15548
> This bug was fixed in JIRA v4.0 and usually only effects customers with lots
> of Issues (100,000's)
>
> When a user saves changes to an Issue, we first store the data in the DB
> (our primary data store), then update the Lucene Index.
> Of course Lucene is not designed for real-time updates, so we need to wait
> in turn to get a write-lock.

As of 2.9, Lucene has "near real-time" search, which in practice can
handle a high update rate & reopening the searcher.  It's called
"near" because it can't make a hard real-time guarantee on turnaround
time like "real time OSs", eg GC could suddenly kick in, large segment
merge just committed, etc., but in practice it's usually sub-second as
long as the update rate isn't too fast.

You'd leave an IndexWriter open, then use that single instance to do
updates, then call writer.getReader() (being sure to close the old
one), wrapped as an IndexSearcher.

> If another long-running write operation is running (eg optimize), then JIRA
> will timeout after a configured amount of time (default 30 seconds) and
> return the request to the user.

I think it'd make sense to by default never optimize?  Have you done
perf tests suggesting optimize is really necessary after a certain
number of issues?  You could also decrease your mergeFactor so the
index in general is maintained with fewer segments.

Also, optimize can now run concurrently, so another option is to allow
it to run in the BG, while periodic updateDocument calls trickle in.

But likely you don't need to optimize, ever, by default.

> Now the DB is up to date, but the Lucene index is stale and won't get fixed
> until another user edits that issue, or you re-index all.
>
> The symptoms are that if you go to the Issue View page you will see your
> issue with latest data because that page goes straight to the DB.
> However, when you use the Issue Navigator for search, you will see the stale
> data from the index.
>
> The proper fix for this is to upgrade to JIRA v4.0.
> However, I think in your case you are waiting for some custom plugins to be
> upgraded to be v4.0 compatible?

I didn't know that custom plugins were preventing us from upgrading...
hopefully infra simply implements the workaround (disabling optimize)
until we can upgrade.

Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-dev-h...@lucene.apache.org

Reply via email to