Commit Graph

323 Commits

Author SHA1 Message Date
cyclesw b8b9194e31 fix uint64_t not defined 2025-03-25 15:41:56 +00:00
Khem Raj 216b86f8d7
Replacing GPR_ASSERT with c assert (#281)
Latest GRPC >= 2.66 has dropped GRPC_ASSERT macro [1]

[1]
0e23c2259d

Upstream-Status: Pending

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2024-11-12 10:14:43 +08:00
zhangxiaoyu.york 662573b6bf
feature:support ipv6 address (#280)
Problem Summary:
Now the etcd client address do not support host format such as
http://[ipv6]:port.

and [RFC
3986](https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2)
```
A host identified by an Internet Protocol literal address, version 6
[[RFC3513](https://datatracker.ietf.org/doc/html/rfc3513)] or later, is distinguished by enclosing the IP literal
within square brackets ("[" and "]").  This is the only place where
square bracket characters are allowed in the URI syntax.  In
anticipation of future, as-yet-undefined IP literal address formats,
an implementation may use an optional version flag to indicate such a
format explicitly rather than rely on heuristic determination.

      IP-literal = "[" ( IPv6address / IPvFuture  ) "]"
```
the ipv6 address is distinguished by enclosing the IP literal within
square brackets ("[" and "]").

What is changed and how it works:
if we find the host part of a URL starts with a "[" and ends with a "]".
it will be specifically judged whether it is a valid IPv6 address. If it
is a valid address, it can be returned directly without call the
`getaddrinfo` interface.
2024-11-12 10:13:53 +08:00
zhangxiaoyu.york 1f6a0726d9
doc:remove rm_if interface param: value in README.md (#279)
remove  rm_if interface param: value in README.md

rm_if define as below:

```
  /**
   * Removes a single key but only if it has a specific value. Fails if the key
   * does not exists or the its value differs from the expected one.
   * @param key is the key to be deleted
   *
   * @return Returns etcdv3::ERROR_KEY_NOT_FOUND if the key does not exist.
   */
  pplx::task<Response> rm_if(std::string const& key,
                             std::string const& old_value);

  /**
   * Removes an existing key only if it has a specific modification index value.
   * Fails if the key does not exists or the modification index of it differs
   * from the expected one.
   * @param key is the key to be deleted
   * @param old_index is the expected index of the existing value
   *
   * @return Returns etcdv3::ERROR_KEY_NOT_FOUND if the key does not exist.
   */
  pplx::task<Response> rm_if(std::string const& key, int64_t old_index);
```
2024-08-23 13:11:42 +08:00
Ye Cao ea56cee80f
Fix install error (#277)
Signed-off-by: Ye Cao <caoye.cao@alibaba-inc.com>
2024-08-02 22:47:25 +08:00
Ye Cao 3ad17314d6
Add the cluster manager api. (#276)
As titled.

Signed-off-by: Ye Cao <caoye.cao@alibaba-inc.com>
2024-08-02 10:30:43 +08:00
Tao He 3a594890c9 Fixes the typo in the CMake options (resolves #272)
Signed-off-by: Tao He <sighingnow@gmail.com>
2024-06-30 23:54:09 +08:00
Khem Raj 17d7b60194
include stdint.h for int64_t types (#270)
This is exposed when compiling for musl platforms where this header is
not included indirectly.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2024-06-30 23:47:20 +08:00
Daniel Tsai ca0e352d55
Fix/add failure behavior #266 (#267)
This MR addresses the behavior mismatch mentioned in
https://github.com/etcd-cpp-apiv3/etcd-cpp-apiv3/issues/266
Have passed the `EtcdSyncTest`
2024-03-13 21:29:03 +08:00
Tao He c911c83c53 Add a test to show that two watchers can co-work
Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
2024-03-13 21:21:34 +08:00
Tao He ba6216385f Bump up the version to v0.15.4
Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
2023-12-20 18:28:15 +08:00
Tao He 5ccaccec43
Enable ipv6 endpoints support (#262)
Resolves #250

Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
2023-12-20 17:56:18 +08:00
Tao He b82efea7a9
Enable -fno-exceptions support (#261)
Resolves #259

Signed-off-by: Tao He <sighingnow@gmail.com>
2023-12-20 09:18:10 +08:00
Tao He 5aff57cce5
Fixes the noisy logs when meets invalid addresses. (#260)
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-12-20 00:32:00 +08:00
penfree 84343ca9f0
Fix: keepalive exit without any message due to clock drift (#258)
Fix:  #257

Co-authored-by: qiupengfei <qiupengfei@baidu.com>
2023-12-19 23:45:19 +08:00
Diskein 59635008c0
Fixes compiler errors (#254)
Co-authored-by: Denis Kalantaevsky <dkalantaevsky@gmail.com>
Co-authored-by: Tao He <sighingnow@gmail.com>
2023-10-05 22:59:06 -05:00
Clément Péron 47f0d9e032
cmake: fix when cross compiling (#252)
To compile protobuf, CMake needs to use the protoc and grpc-cpp-plugin
in the host architecture.

Unfortunately by default the protoc and grpc-cpp-plugin are the one for
the Target.
And since gRPC 1.52 they are explictly not exported when Cross Compiling
to avoid architecture mismatch.
See:
831d2a6855

Fix this by looking at the correct program

See example.
https://github.com/grpc/grpc/blob/master/examples/cpp/cmake/common.cmake#L54-L62

Signed-off-by: Clément Péron <peron.clem@gmail.com>
2023-09-25 09:49:24 +08:00
Tao He 6fc1f164c0
Fixes the extra-smi error in code generated by protobuf (#251)
Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
2023-09-19 20:42:49 +08:00
Tao He e31ac4d4ca Bump up etcd-cpp-apiv3 to v0.15.3
Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
2023-07-27 11:28:00 +08:00
JonLiu1993 e5dc903a5d
Fix error LNK1107 and undeclared identifier 'IPPROTO_TCP' (#244)
When I [Update](https://github.com/microsoft/vcpkg/pull/32747)
etcd-cpp-apiv3 version from 0.14.2 to 0.15.2, I get two build error:
````
fatal error LNK1107: invalid or corrupt file: cannot read at 0x330
````
````
error: use of undeclared identifier 'IPPROTO_TCP'
````

The first error was because the target `etcd-cpp-api-core-objects`
linked the wrong `libprotobufd.dll` file instead of the .lib file, I
used the usage provided by vcpkg to link the correct .lib file to fix
this error.

Another error was because `IPPROTO_TCP` was missing declaration
`"<netinet/in.h>"`, I added it to fix this error.

---------

Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
Co-authored-by: Zhao Liu <v-zhli17@microsoft.com>
Co-authored-by: Tao He <linzhu.ht@alibaba-inc.com>
2023-07-27 11:27:19 +08:00
Tao He 0eee75b52e
KeepAlive: auto grant a new lease if 0 is given as lease id (#242)
Fixes #3037

Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
2023-07-20 14:21:27 +08:00
Tao He 15c022e36c Bump up etcd-cpp-apiv3 to v0.15.2
Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
2023-07-17 10:44:06 +08:00
Tao He 3d344190d7
Fixes txn delete response to keep backwards compatibility (#239)
Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
2023-07-17 10:43:19 +08:00
Tao He 2c0d824ebe Bump up etcd-cpp-apiv3 to v0.15.1
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-07-15 20:23:01 +08:00
Tao He 068f37ba5c
Fixes the watcher cannot be cancelled issue with etcd 3.x (#238)
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-07-15 20:00:16 +08:00
Tao He 153546f965
Refactor the implementation of etcd transactions. (#236)
Fixes #234.

Signed-off-by: Tao He <sighingnow@gmail.com>
2023-07-15 17:07:34 +08:00
Tao He 204038c4bc Fixes format issues
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-07-01 21:03:20 +08:00
Tao He d57dff2f86 Bump up etcd-cpp-apiv3 to v0.15.0
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-07-01 20:50:22 +08:00
Tao He 1d5128a7e8
Format source code using clformat (#233)
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-07-01 20:49:16 +08:00
Tao He fe9f17e61e
Fixes a possible bug about watcher's id (#232)
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-07-01 18:41:33 +08:00
Tao He 32fae70113
Fixes the implementation of Observe() (#231)
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-07-01 13:30:43 +08:00
Tao He 09f665fe3e Format readme.md
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-06-30 15:37:27 +08:00
Tao He fcc5807748 Fixes a typo in README (fixes #229).
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-06-30 15:34:54 +08:00
Tao He dd2c0276aa
Find protobuf in CONFIG mode to fixes the absl dependencies. (#225)
See also: https://github.com/protocolbuffers/protobuf/issues/12292.

Signed-off-by: Tao He <sighingnow@gmail.com>
2023-06-15 13:47:39 +08:00
Tao He a8d5980c76
Include watch_id in the response (#223)
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-05-16 09:45:51 +08:00
Tao He 0ed7bee2c8
Merge the .hpp/.cpp into one to optimize build time (#220)
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-05-11 14:09:41 +08:00
Tao He e771d2f6da
Drop the boost dependency on the sync runtime (#216)
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-04-28 20:38:13 +08:00
Tao He 5e2884f362 Bump up etcd-cpp-apiv3 to v0.14.3
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-04-27 11:07:10 +08:00
Tao He ebf9c493f1
Get and list keys with specified revision. (#215)
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-04-26 21:06:23 +08:00
Tao He a288eb5db4 Add the test case for issue #212
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-04-21 16:53:19 +08:00
Tao He 24b1414118 Ubuntu 18.04 is no longer available on Github actions
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-04-20 21:16:00 +08:00
Tao He 91c64e18d3 The grpc_cpp_plugin may failed to be found, and leads to conflicts
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-04-20 20:42:10 +08:00
Tao He af0c96f6ba
The grpc_cpp_plugin may failed to be found (#211)
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-04-20 19:50:27 +08:00
Tao He 6e4b45f986 Bump up the version to v0.14.2 2023-03-19 11:32:49 +08:00
Tao He c72e072f77
Add an option `BUILD_ETCD_CORE_ONLY=ON/OFF` to select the runtime (#208)
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-03-19 11:31:57 +08:00
Tao He 16a9638e3e Fixes a markup error in README.md
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-03-15 10:12:59 +08:00
Tao He 66cf911654 Bump up the version to v0.14.1 as a bugfix release
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-03-14 20:41:03 +08:00
Tao He 9fc0f37ef7
Fixes a bug in lease action when grpc timeout is set (#204)
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-03-14 20:37:34 +08:00
Tao He 5e27ac33c6
Fixes the segmentation fault error in watcher (#206)
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-03-14 20:36:53 +08:00
Tao He f0f9c4e8c2
Enhance the campaign test and document the behaviour when timeout is set (#205)
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-03-14 19:43:37 +08:00