Repository navigation
Description
Today, with the release of 2.3.0, my node.js code stopped working against a 2.2.5 server:
undefined:1
ERROR: Received an unsupported protocol version. This port is for RethinkDB queries. Does your client driver version not match the server?
^
SyntaxError: Unexpected token E
at Object.parse (native)
at Socket.callback.rawSocket.once.handshake_callback (/code/node_modules/float-rethinkdb/node_modules/rethinkdb/net.js:624:35)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at readableAddChunk (_stream_readable.js:146:16)
at Socket.Readable.push (_stream_readable.js:110:10)
at TCP.onread (net.js:523:20)
My package.json setup is:
"rethinkdb": "^2.2.1"
This should allow upgrade to all 2.x.y releases. According to semver, those releases would not break compatibility. (Where major versions break compatibility, minor versions add functionality and patch versions fix bugs.)
Because 2.3.0 breaks compatibility with 2.2.x servers, this broke my setup.
I've since changed my package.json spec to:
"rethinkdb": "~2.2.1"
Which will only update the patch version.
However, I felt I should open this issue to foster discussion of Rethinkdb not following semver. My personal opinion is that following semver makes it very easy and predictable for end users: major version changes are not compatible, minor version changes add functionality but are compatible, patch version changes only address bugs and do not affect functionality or compatibility.
What is the current thinking on Rethinkdb versioning? Is my change to only allow patch version changes really safe to do or do I need to lock things down to specific versions?
Activity
danielmewes commentedon Apr 6, 2016
Thanks for bringing this up again @andyburke (we had some prior discussions about this in another issue, I have to look up which one it was). This is indeed a convincing example for why we should strongly consider switching to semver for our driver. The reason for why we don't use it at the moment is to keep the driver versions similar to the corresponding server versions, so you can easily tell which driver works with which server.
We could use something like
23.0.0instead of2.3.0maybe, or even203.0.0if we want to make sure that the version schema still works if we ever reach2.10.xfor the server.andyburke commentedon Apr 7, 2016
Is there a particular reason to avoid using semver on the server side? The semver concepts aren't really tied to javascript.
It can lead to high version numbers if you are moving fast and breaking backward compatibility often, but that isn't a problem as long as you're ok with versions like 14.3.2.
danielmewes commentedon Apr 21, 2016
@andyburke Switching server versioning over as well is worth considering. Though I think it is less important than for the drivers.
Our current versioning scheme also has the advantage that we can point out particularly major milestones, such as the jump from 1.x.x to 2.x.x.
andyburke commentedon Apr 21, 2016
Sadly, version numbers have been imbued with this idea from a marketing perspective: 2.0 is better than 1.0, right?
One way some people/companies are separating information/PR/marketing (none of which are bad) from versioning is to have named releases. It's fun, and it leaves the versions mostly out of it so they can be driven by the APIs and developer needs, eg:
In the example, backwards compatibility has been maintained, but major new features have also been added. By using names to call out the big bundles of work instead of a major version bump, code can continue to understand when it can and cannot interoperate.
Thanks for considering and discussing the issue, I appreciate it.
mike-marcacci commentedon Aug 24, 2016
I just wanted to add another quick note that there is another factor at play here – having the same version shared across all client libs and the database itself is extremely useful. I know that elastica had such a problem with confusion from different versions that they're unifying everything in their stack under "5.0" shortly.
At the same time, semver is critical in client libraries, since it's obeyed by just about every popular package manager.
Perhaps "major" numbers should be shared by the database and all clients (and increment any time a database API change is made, breaking or not); "minor" and "patch" numbers could then follow the semantics of semver for each client library, while the server is more or less constrained to
<major>.0.<patch>.Just an idea.