mfenniak / rethinkdb-net

A C# / .NET client driver for RethinkDB.
Other
247 stars 37 forks source link

TableCreate optional argument 'datacenter' no longer functions. #247

Closed samkelleher closed 3 years ago

samkelleher commented 8 years ago
Client error: Unrecognized optional argument `datacenter`.
   at RethinkDb.Connection.<RunAsync>c__async4`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at RethinkDb.ConnectionFactories.ReliableConnectionFactory.ReliableConnectionWrapper.<RetryRunAsync>c__async0`1.MoveNext()

I think the API for it on RethinkDB has since changed. Using RethinkDB v2.2.2

mfenniak commented 8 years ago

Yup, you're right, the API has changed since this was first implemented. Looks like there is now a primary_replica_tag field rather than datacenter. Will have to update this, and this time find a way to write some relevant integration tests, as this should've been caught by tests.

https://github.com/rethinkdb/rethinkdb/blob/60a604af0a02d1cb03989d8efa883b357f9f0dbc/src/rdb_protocol/ql2.proto#L506

samkelleher commented 8 years ago

This one in particular is complicated because the primary replica tag needs to be supplied along side the actual list of replicas you want to create. I.e. the primary tag must be in the list. So this particular method would need to have that too. There's also a bunch of other options available when creating a table related to replicas and sharding, like non-voting replicas. So maybe a method that accepts a dynamic object that is serialised would be more flexible and allow adding and removing options as RethinkDB changes.