# Will there be any new client API in 7.0?

**URL:** <https://forums.foundationdb.org/t/will-there-be-any-new-client-api-in-7-0/1915>\
**Category:** Development\
**Created:** [January 28, 2020, 2:35pm UTC](https://forums.foundationdb.org/t/will-there-be-any-new-client-api-in-7-0/1915 "2020-01-28T14:35:10Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![KrzysFR](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/krzysfr/32/43_2.png) [@KrzysFR](https://forums.foundationdb.org/u/KrzysFR)\
**Post date:** [January 28, 2020, 2:35pm UTC](https://forums.foundationdb.org/t/will-there-be-any-new-client-api-in-7-0/1915/1 "2020-01-28T14:35:10Z")

</div>

It looks like there will a pre-release of 7.0 soon, and right now, the release notes page ([https://github.com/apple/foundationdb/blob/master/documentation/sphinx/source/release-notes.rst](https://github.com/apple/foundationdb/blob/master/documentation/sphinx/source/release-notes.rst)) doesn’t seem to mention any change to the C API.

Will this be true for the entire 7.0 release? If yes, does this mean that there will be no real need to change API level from 620 to 700, on the application side? Or will there still be changes that will be selected depending on 620 or 700?

---

<div class="post-metadata">

**Author:** ![ajbeamon](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/ajbeamon/32/13_2.png) [@ajbeamon](https://forums.foundationdb.org/u/ajbeamon)\
**Post date:** [January 28, 2020, 4:43pm UTC](https://forums.foundationdb.org/t/will-there-be-any-new-client-api-in-7-0/1915/2 "2020-01-28T16:43:20Z")

</div>

I think this PR that adds the ability to get a size estimate for a range is likely to make it in:

> <https://github.com/apple/foundationdb/pull/2537>
>
> …servers to fdb\_c library
> 
> This PR will resolve #1122

I think this issue to change a type to not be void\* will be done too, though hopefully there won’t be any need to version it:

> <https://github.com/apple/foundationdb/issues/2495>
>
> The \`FDBKeyValue\` struct is currently defined as:
> 
> typedef struct keyvalue… {
> const void\* key;
> int key\_length;
> const void\* value;
> int value\_length;
> } FDBKeyValue;
> 
> where \`key\` and \`value\` are of type \`const void \*\`. However, in the other \`transaction\` functions, keys and values are of type \`uint8\_t const \*\`. Is there a reason for this? Using the same type in \`FDBKeyValue\` would avoid having to cast to use it in a different operation.

We also have a transaction option (`include_port_in_address`) that is documented as being the default behavior in version 700, with the option itself becoming deprecated.

It’s possible there will be other changes in the C API, though I can’t think of any at the moment.

> [@KrzysFR](#):
>
> If yes, does this mean that there will be no real need to change API level from 620 to 700, on the application side?

The option change would be switchable by the API version, and if you plan to access the new range size API it would be best to specify 700 as your API version. I think it may technically still be possible to access the new API from old versions, though.

---

<div class="post-metadata">

**Author:** ![KrzysFR](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/krzysfr/32/43_2.png) [@KrzysFR](https://forums.foundationdb.org/u/KrzysFR)\
**Post date:** [January 28, 2020, 5:17pm UTC](https://forums.foundationdb.org/t/will-there-be-any-new-client-api-in-7-0/1915/3 "2020-01-28T17:17:01Z")

</div>

I like the `fdb_transaction_get_estimated_range_size_bytes` API 🙂

> [@ajbeamon](#):
>
> We also have a transaction option ( `include_port_in_address` ) that is documented as being the default behavior in version 700, with the option itself becoming deprecated.

Yes I remember seeing this comment in the options now. I think I will add a method in the binding that return the ports, and set the transaction option for 620, does nothing for 700+ and throws for \< 620.

> [@ajbeamon](#):
>
> I think this issue to change a type to not be void\* will be done too, though hopefully there won’t be any need to version it

This should be transparent hopefully for most binding.

---

<div class="post-metadata">

**Author:** ![Daniel-B-Smith](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/daniel-b-smith/32/743_2.png) [@Daniel-B-Smith](https://forums.foundationdb.org/u/Daniel-B-Smith)\
**Post date:** [January 29, 2020, 7:44pm UTC](https://forums.foundationdb.org/t/will-there-be-any-new-client-api-in-7-0/1915/4 "2020-01-29T19:44:58Z")

</div>

Should wrappers of the C 6.2 API work with the server in master now?\* I’m seeing 100% of transactions timing out, and the transactions aren’t showing up in fdbcli. There might be something else going on, but this is one of my first guesses.

/\* Specifically [https://github.com/Clikengo/foundationdb-rs](https://github.com/Clikengo/foundationdb-rs) 0.4.1 and fdbserver at bfcdf6bc88856647425efc0b3f184f2c44cd8d89

---

<div class="post-metadata">

**Author:** ![ajbeamon](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/ajbeamon/32/13_2.png) [@ajbeamon](https://forums.foundationdb.org/u/ajbeamon)\
**Post date:** [January 29, 2020, 7:48pm UTC](https://forums.foundationdb.org/t/will-there-be-any-new-client-api-in-7-0/1915/5 "2020-01-29T19:48:07Z")

</div>

> [@Daniel-B-Smith](#):
>
> Should wrappers of the C 6.2 API work with the server in master now?

Version 6.2 is protocol incompatible with master, so you won’t be able to use a 6.2 client library with it. If you want to connect to a cluster based on the master branch, you would also need to build a client library from the master branch and use that.

---

<div class="post-metadata">

**Author:** ![Daniel-B-Smith](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/daniel-b-smith/32/743_2.png) [@Daniel-B-Smith](https://forums.foundationdb.org/u/Daniel-B-Smith)\
**Post date:** [January 29, 2020, 7:50pm UTC](https://forums.foundationdb.org/t/will-there-be-any-new-client-api-in-7-0/1915/6 "2020-01-29T19:50:46Z")

</div>

I’m linking against a client library built from master, but the wrapper is based on 6.2, if that makes any sense.

---

<div class="post-metadata">

**Author:** ![alexmiller](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/alexmiller/32/326_2.png) [@alexmiller](https://forums.foundationdb.org/u/alexmiller)\
**Post date:** [January 29, 2020, 7:51pm UTC](https://forums.foundationdb.org/t/will-there-be-any-new-client-api-in-7-0/1915/7 "2020-01-29T19:51:43Z")

</div>

Bindings written against 6.2 will work with any future released client library.

I will assume that you’re running into the issue that a 6.2 client library can only talk to a 6.2 server, and a client library built from master should only be used with an fdbserver built from the same version of master.

fdbcli does not use the multi version client library, so if fdbcli works, it would sound like your bindings are picking up a mismatching client library version from somewhere other than what you built.

---

<div class="post-metadata">

**Author:** ![ajbeamon](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/ajbeamon/32/13_2.png) [@ajbeamon](https://forums.foundationdb.org/u/ajbeamon)\
**Post date:** [January 29, 2020, 7:56pm UTC](https://forums.foundationdb.org/t/will-there-be-any-new-client-api-in-7-0/1915/8 "2020-01-29T19:56:32Z")

</div>

It should be fine to run client code against an old API version like 620, and in fact I’ve been running some of my own tests today that do exactly that. One thing to check is the trace logs for the server and/or the client. I believe if you have an incompatibility, you would see events like `ConnectionRejected` with a reason `IncompatibleProtocolVersion`, and possibly also `IncompatibleConnectionClosed`.

If you don’t see either of those, then the trace logs might provide other clues if there’s some problem establishing a connection to the cluster.

---

<div class="post-metadata">

**Author:** ![Daniel-B-Smith](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/daniel-b-smith/32/743_2.png) [@Daniel-B-Smith](https://forums.foundationdb.org/u/Daniel-B-Smith)\
**Post date:** [January 30, 2020, 7:39pm UTC](https://forums.foundationdb.org/t/will-there-be-any-new-client-api-in-7-0/1915/9 "2020-01-30T19:39:58Z")

</div>

Thanks! Looking for `ConnectionRejected` helped me track down the incompatibility problem.
