.net client to get not stale view
hi,
i had an issue with keeping getting views having old (stake) documents.
After some investigation i found http://www.couchbase.com/forums/thread/stalefalse-supported which explained that view is updated just from the records written onto the disc.
in http://www.couchbase.com/wiki/display/couchbase/Observe i found how to execute storing with persist parameter.
What i want to be sure is that the storing function blocks till the change is written to disc and thus be available for the view. What i see is that while java client is blocking, .net client just returns false as result when i call ExecuteStore(StoreMode.Add, key, value, PersistTo.One);
is that correct?
Lubos
hi,
what exactly means "persisted" ? if i specify persist to one node, does it mean persist to memory or to disc really?
thanks
Lubos
ExecuteStore with PersistTo.One will return true if and only if the key has been persisted to disk.
hi,
thanks for your answer.
I tried to call ExecuteStore with PersistTo.One argument. Problem is that it always returns false...
i have set no replication on my bucket - could that be a reason?
L
If you're not specifying replication as an argument, that wouldn't impact it. Which version of the client are you using? The latest beta? You can check the StatusCode or Message properties on the IStoreOperationResult that is returned by ExecuteStore. Also, please note that Observe isn't officially released as the client is in beta, so there will be some bug fixes coming to Observe in the coming days.
hi,
i'm using .net client 1.2 beta. such call always ends up with result = false and message says like "Observe operation has timed out"...
Actually this is very problematic for us. We need (at least for certain part of our application) really consistent views - which means if i insert/update batch of objects in the loop and then immediately call GetView (stale = false) then i need to get all object i saved with first call. Same for Remove - if i remove 10k objects in the loop then i expect when i try to get view that view will be empty...
is there any change to get this stuff working in short term? what are release dates for couchbase 2.0 anyway ?
thanks
Lubos
Hi Lubos,
There are a number of fixes to the beta client (including Observe) that are in the final stages of code review. I anticipate having a release later this week.
Are you using code config for your client? One of the items that was fixed was to include a default timeout for code config. http://www.couchbase.com/issues/browse/NCBC-124
-- John
hi john,
i think as long as Remove method doesn't support same overload as Store (i mean it's blocking till data are really written to disc) thus data are then directly consistently reflected in view we cannot use views.
at least in my understanding, views just reflect data which is written directly to disc. To workaround this, we'd have to have blocking methods for insert,update and delete which returns just when the change is really persisted to disc.
is my understanding correct ?
rgds
Lubos
Hi Lubos,
I've created a Jira ticket to track the addition of Remove with Observe. It's at http://www.couchbase.com/issues/browse/NCBC-163. The patch for the update is under code review at http://review.couchbase.org/#/c/22836/1. I'll get this into the 1.2 version of the .NET client. In the meantime, you are able to call Observe directly yourself (after a call to Remove), as it's a public method exposed by CouchbaseClient.
-- John
FYI - the 1.2 client has Remove with Observe.
Hi Lubos,
The .NET Store method will block until either a) the key has been persisted to the number of nodes you've specified or b) the operation times out (default is 1:00).