[PCBC-144] getVersion() returns memcached version, not couchbase version Created: 10/Nov/12 Updated: 11/Dec/12 Resolved: 06/Dec/12 |
|
| Status: | Resolved |
| Project: | Couchbase PHP client library |
| Component/s: | library |
| Affects Version/s: | 1.1.0-dp5 |
| Fix Version/s: | 1.1.0 |
| Security Level: | Public |
| Type: | Improvement | Priority: | Minor |
| Reporter: | Michael Nitschinger | Assignee: | Trond Norbye |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
For whatever reason, when doing getVersion() on the php ext the showed version is not the couchbase one. I assume its the memcached one, but I think this will only confuse people.
Is it possible to change this to the corresponding couchbase version? array(2) { '192.168.56.101:11210' => string(18) "1.4.4_600_g7ea975a" '192.168.56.102:11210' => string(18) "1.4.4_600_g7ea975a" } Michael |
| Comments |
| Comment by Matt Ingenthron [ 11/Nov/12 ] |
| Unfortunately, this is a bit correct. The memcached protocol "version" command returns that string. We're simply returning what the server says. I know it's a bit confusing in this instance. I think I'd asked for this behavior, but maybe we need to reconsider it a bit. |
| Comment by Matt Ingenthron [ 11/Nov/12 ] |
|
Trond: not assigning this to you to fix it, but rather just to get your opinion on what we should do here. We have a getVersion() which maps to the memcached protocol version command. Given that our server returns this string, should we change the behavior of getVersion() on the client? My current feeling is no. Besides, this issue has never been reported by a real user. We're staying true to the interface we intended to implement, it's not our fault that the string coming back is confusing. What do you think? |
| Comment by Trond Norbye [ 12/Nov/12 ] |
| I don't have a printout of what the REST response from the server looks like, but I think we should add a call to the library we may use to retrieve that version. I don't think we should change the current getVersion() (in case someone use that already), but rather have something like getClusterVersion (or getNodeVersion). The cluster may be running multiple versions during an upgrade scenario... |
| Comment by Michael Nitschinger [ 12/Nov/12 ] |
| If this is easily achievable, I'd definitely vote for it. It could be done the same way as getVersion() that returns an array for each node with the corresponding version. |
| Comment by Trond Norbye [ 06/Dec/12 ] |
|
This is easily achieved with something among the lines of:
<?php $cb = new CouchbaseClusterManager("localhost", "Administrator", "asdasd"); $info = json_decode($cb->getInfo()); foreach ($info->{"nodes"} as $node) { print $node->{"hostname"} . " is running " . $node->{"version"} . "\n"; } ?> |