[RCBC-186] Description of locking potentially misleading Created: 19/Oct/14  Updated: 20/Oct/14

Status: Open
Project: Couchbase Ruby client library
Component/s: docs
Affects Version/s: 1.3.9
Fix Version/s: None
Security Level: Public

Type: Bug Priority: Major
Reporter: Chris Malarky Assignee: Sergey Avseyev
Resolution: Unresolved Votes: 0
Labels: documentation
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates to
relates to MB-12379 Default and Maximum lock time describ... Open

 Description   
The maximum lock in 2.5.1 and 3.0.0 is 30 secs, the default is 15 seconds. Any attempt to set a lock higher than the maximum results in the default being used. The Ruby Developer Guide needs updating to more accurately reflect this behaviour.

Also, the lock option is not mentioned at all in the API document.

 Comments   
Comment by Sergey Avseyev [ 20/Oct/14 ]
Have you seen documentation on get method?
http://www.couchbase.com/autodocs/couchbase-ruby-client-1.3.8/Couchbase/Bucket.html#get-instance_method

> :lock (Fixnum, Boolean) — Lock the keys for time span. If this parameter is true the key(s) will
> be locked for default timeout. Also you can use number to setup your own timeout in seconds.
> If it will be lower that zero or exceed the maximum, the server will use default value. You can
> determine actual default and maximum values calling #stats without arguments and inspecting
> keys “ep_getl_default_timeout” and “ep_getl_max_timeout” correspondingly

I think that both settings configurable, this is why I decided that I should not include it as literal into client's documentation, because it might get outdated once the server will change it or will be reconfigured by the administrator.

it is very easy to get defaults in runtime, and it is decribed in ruby docs

  ~ $ irb
  irb(main):001:0> bucket = Couchbase.connect
  #<Couchbase::Bucket:0x00000003794e58 "http://localhost:8091/pools/default/buckets/default/" transcoder=Couchbase::Transcoder::Document, default_flags=0x0, quiet=false, connected=true, timeout=2500000, bootstrap_transport=:http>
  irb(main):002:0> bucket.stats.select { |k, _| k =~ /ep_getl_/ }
  {
      "ep_getl_default_timeout" => {
          "localhost:11210" => "15"
      },
          "ep_getl_max_timeout" => {
          "localhost:11210" => "30"
      }
  }
Comment by Chris Malarky [ 20/Oct/14 ]
I hadn't seen that, but it looks good. I didn't see that page, sorry, the navigation wasn't obvious.

This page though: http://docs.couchbase.com/couchbase-sdk-ruby-1.3/#pessimistic-locking is where you end up from the in-site navigation, does that need fixing?

Not sure if the values are configurable yet.




Generated at Fri Oct 24 07:23:06 CDT 2014 using JIRA 5.2.4#845-sha1:c9f4cc41abe72fb236945343a1f485c2c844dac9.