WaitForNonStaleResults variations

58 views
Skip to first unread message

Mark

unread,
Mar 2, 2012, 4:44:48 AM3/2/12
to ravendb
Hi,

Is there somewhere that explains exactly how the waiting for none
stale results methods work and behave?

We've been using WaitForNonStaleResults() after creating a new index
and querying on it, but this times out after 15 seconds no matter what
we specify as the TimeSpan parameter with message:

"Waited for 15,215ms for the query to return non stale result"

This also happens if we use
WaitForNonStaleResultsAsOfLastWrite/WaitForNonStaleResultsAsOfNow.

My dev machine may be just a bit slow and the eventual production
server will be faster, but we really need to wait for however long it
takes on the first go after creating the index, otherwise the user
gets nothing back. (so for instance they expect to see 100 documents
but get nothing).

Also what are the rules regarding auto promotion of dynamic indexes?
How many hits does it need before raven promotes it?

Thanks
Mark

Oren Eini (Ayende Rahien)

unread,
Mar 2, 2012, 4:48:04 AM3/2/12
to rav...@googlegroups.com
Mark,
Wait For Non Stale Results work something like this:

while true:
   queryResults = QueryServer()
   if(queryResults.IsStale == false)
      break
      
   if(elapsed > timespan)
    throw
   Sleep(100)


What is it that you are actually doing? Are you using dynamic indexes for that?

Mark

unread,
Mar 2, 2012, 4:55:19 AM3/2/12
to ravendb
Hi,

We are using a dynamic index which is obviously created based on our
query. Then we hope to promote it to a full index.

The reasoning behind this is that

a) It is problematic creating an up front static index, because our
documents are "dynamically structured"
b) Promoting a dynamic index means we only index what we really need
(what they are searching on) and can be done at runtime
c) If the user changes the document structure we can detect changes in
the query and promote that new index.

Sort of just to late static index creation.

Does that make sense?

Thanks




On Mar 2, 9:48 am, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
wrote:

Oren Eini (Ayende Rahien)

unread,
Mar 2, 2012, 5:12:11 AM3/2/12
to rav...@googlegroups.com
Mark,
How do you retire old indexes?

If you have dynamic data, use dynamic fields in a statically defined index, that is the best way to go about it.

Lorenzo Melato

unread,
Mar 2, 2012, 9:30:41 AM3/2/12
to rav...@googlegroups.com
And what about the other variations of  WaitForNonStaleResultsXYZ ?

Lorenzo

Oren Eini (Ayende Rahien)

unread,
Mar 2, 2012, 3:13:45 PM3/2/12
to rav...@googlegroups.com
They relate to how we detect whatever a query returned stale results or not.
Reply all
Reply to author
Forward
0 new messages