Coder Social home page Coder Social logo

kudu-client-net's People

Contributors

xqrzd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

kudu-client-net's Issues

Kudu 1.12 Changes

Issue for tracking changes needed for the next release of Kudu

  • Regenerate protobuf contracts
  • e2b2fb25335fe517e46cdd61924698b36e9cc652 - KUDU-1938 [java] Add support for VARCHAR pt 4
  • 1b945e16b29bb445932c5e59853ac73e9aba69c1 - [client] retry to connect to the cluster when specifing a superset of masters
  • 5067abbdd2dc95eea74072dec1b07e3c0eb98423 - [util] Import FastHash hash function to util
  • 62f6a300a5c092a6c61c91fe1546014eb8787b6e - [KUDU-2632] Add a DATE type backed by INT32 (Part 2, Java client)
  • 14234a62c6dec587d5a8cb6a0ff3e3b3a9154409 - [java] KUDU-1563. Add support for INSERT_IGNORE

Remaining work for first release

This issue tracks all remaining missing features before this library will be published. This list is incomplete, and will be extended.

Needed for first alpha/beta release:

  • General fault tolerance
  • Authz token support
  • Decide on library name (currently leaning towards Knet.Kudu.Client)
  • Implement logging (with LibLog deprecated, leaning towards Microsoft.Extensions.Logging)
  • Ensure client timestamp propagation is working properly
  • Ensure exactly-once RPCs are working properly
  • API review
  • Fix session
  • Rework table builder (plus support for setting comments, default read/write values)
  • CancellationToken support
  • Optimize key encoding, and verify vectorized implementation
  • Account for changing range partitions in WriteAsync
  • Send required features for relevant RPCs
  • Alter table support
  • Capture deserialization errors, and throw them from KuduConnection.SendReceiveAsync
  • Add default value to ColumnSchema
  • Support setting date default value

Needed for first stable release:

  • Add more tests
  • KuduRpc cleanup
  • Scanner cleanup
  • Scan tokens
  • Scanner auto-mapper (via expression trees)
  • Fault tolerant scanners
  • Per-tserver queue session (future)
  • Improve exception stack trace (avoid large recursive stack trace)
  • Scanner keep-alive
  • Expose scan metrics
  • Enhance tablet cache so it can be used for scan tokens
  • KuduPredicate cleanup + optimizations
  • Final API review
  • Documentation
  • Expose session errors
  • Expose partitioner
  • Refactor parsing logic
  • [assembly: CLSCompliant(true)]

Setup Windows tests

Test Kudu on Windows (.NET Framework + .NET Core). Kudu runs on Windows in docker, that may be a good option.

CI Matrix

Setup test matrix with .NET Core (2.1, 3.0), Mono, and Kudu (1.5, 1.6, 1.7.1, 1.8, 1.9).

Connect to tablet servers using authn tokens

Currently the client uses Kerberos to authenticate to master and tablet servers. The client should instead use the authn token it receives from connecting to a master to connect to tablet servers.

Tests sometimes stall

Even the unit tests stall; complete deadlock. Maybe thread pool exhausted? Happens very rarely on CI build.

TestMasterFailover is flaky

This test has failed a few times in CI:

[xUnit.net 00:02:26.32]     Knet.Kudu.Client.FunctionalTests.MasterFailoverTests.TestMasterFailover(killBefore: CreateClient, restart: False) [FAIL]
  X Knet.Kudu.Client.FunctionalTests.MasterFailoverTests.TestMasterFailover(killBefore: CreateClient, restart: False) [38s 370ms]
  Error Message:
   System.OperationCanceledException : Couldn't complete RPC before timeout: Leader not yet ready to serve requests
---- Knet.Kudu.Client.Exceptions.RecoverableException : Leader not yet ready to serve requests
  Stack Trace:
     at Knet.Kudu.Client.KuduClient.SendRpcAsync[T](KuduRpc`1 rpc, CancellationToken cancellationToken) in /home/runner/work/kudu-client-net/kudu-client-net/src/Knet.Kudu.Client/KuduClient.cs:line 1096
   at Knet.Kudu.Client.KuduClient.WaitForCreateTableDoneAsync(TableIdentifierPB tableId, CancellationToken cancellationToken) in /home/runner/work/kudu-client-net/kudu-client-net/src/Knet.Kudu.Client/KuduClient.cs:line 236
   at Knet.Kudu.Client.KuduClient.CreateTableAsync(TableBuilder tableBuilder, CancellationToken cancellationToken) in /home/runner/work/kudu-client-net/kudu-client-net/src/Knet.Kudu.Client/KuduClient.cs:line 191
   at Knet.Kudu.Client.FunctionalTests.MasterFailoverTests.TestMasterFailover(KillBefore killBefore, Boolean restart) in /home/runner/work/kudu-client-net/kudu-client-net/test/Knet.Kudu.Client.FunctionalTests/MasterFailoverTests.cs:line 43
   at Knet.Kudu.Client.FunctionalTests.MasterFailoverTests.TestMasterFailover(KillBefore killBefore, Boolean restart) in /home/runner/work/kudu-client-net/kudu-client-net/test/Knet.Kudu.Client.FunctionalTests/MasterFailoverTests.cs:line 57
   at Knet.Kudu.Client.FunctionalTests.MasterFailoverTests.TestMasterFailover(KillBefore killBefore, Boolean restart) in /home/runner/work/kudu-client-net/kudu-client-net/test/Knet.Kudu.Client.FunctionalTests/MasterFailoverTests.cs:line 57
--- End of stack trace from previous location where exception was thrown ---
----- Inner Stack Trace -----
   at Knet.Kudu.Client.KuduClient.SendRpcToMasterAsync[T](KuduMasterRpc`1 rpc, ServerInfo serverInfo, CancellationToken cancellationToken) in /home/runner/work/kudu-client-net/kudu-client-net/src/Knet.Kudu.Client/KuduClient.cs:line 1263
   at Knet.Kudu.Client.KuduClient.SendRpcToMasterAsync[T](KuduMasterRpc`1 rpc, CancellationToken cancellationToken) in /home/runner/work/kudu-client-net/kudu-client-net/src/Knet.Kudu.Client/KuduClient.cs:line 1147
   at Knet.Kudu.Client.KuduClient.SendRpcAsync[T](KuduRpc`1 rpc, CancellationToken cancellationToken)

Kudu 1.11 Changes

Issue for tracking changes needed for the next release of Kudu

  • Regenerate protobuf contracts
  • c6fa43362f79b4adc1b489d04d5b0820b44b68ff - KUDU-2823 [java client] Support setting dimension for the newly created tablet
  • d8aeab7f97a76275e6f7f647099c5b339961c623 - Deprecated TabletLocationsPB.ReplicaPB message in client
  • d46c14179312a756620eb373fcccfb429c51cb2d - KUDU-2348: Pick a random replica in RemoteTablet.java
  • 8c68c946d467a466fa2d7f21c283fc083d380d29 - [java] KUDU-2873: attach authz tokens to SplitKeyRangeRequests
  • c4308869580c6cb8b57a809395883a0b2614f883 - [java] Add unit tests demonstrating good behavior of scan tokens when range partitions are dropped
  • e233e7c127db1f593be1b0f477267c060f7dd6f3 - KUDU-2921: Exposing the table statistics to spark relation.

Kudu 1.13 Changes

Issue for tracking changes in the next release of Kudu

  • Regenerate protobuf contracts
  • 4bf7e457b054d9bfb002e3971113e2152b92951a - [client] support resolve one master address to multiple addresses
  • 8d4853f1525fb189a9ca232544ffd01ac2a39c57 - clients: prefer tservers in the same location when multiple are local
  • 34e85622f37f88b0436d9ba51df7592bf0e159de - Support columnar row format
  • d23ee5d38ddc4317f431dd65df0c825c00cc968a - KUDU-1802: Avoid calls to master when using scan tokens
  • 59813014099a3c433734c7c58268ddfb80d69055 - KUDU-3090 Ownership support in Java client

TFM support

The following TFMs are planned for support:

  • .NET Standard 2.0 (Oldest supported platform, allows using the client on most .NET runtimes)
  • .NET Core 2.1 (For various memory and performance optimizations)
  • .NET Standard 2.1 (Same as above, but for more platforms)
  • .NET Core 3.0 (Hardware intrinsics)

TestKeepAlive is flaky

This test has failed in a couple different places,

[xUnit.net 00:00:10.61]     Knet.Kudu.Client.FunctionalTests.ScannerTests.TestKeepAlive [FAIL]
  X Knet.Kudu.Client.FunctionalTests.ScannerTests.TestKeepAlive [9s 533ms]
  Error Message:
   System.Exception : Scanner has already been closed
  Stack Trace:
     at Knet.Kudu.Client.KuduScanEnumerator`1.KeepAliveAsync(CancellationToken cancellationToken) in /home/runner/work/kudu-client-net/kudu-client-net/src/Knet.Kudu.Client/KuduScanEnumerator.cs:line 277
   at Knet.Kudu.Client.FunctionalTests.ScannerTests.TestKeepAlive() in /home/runner/work/kudu-client-net/kudu-client-net/test/Knet.Kudu.Client.FunctionalTests/ScannerTests.cs:line 195
   at Knet.Kudu.Client.FunctionalTests.ScannerTests.TestKeepAlive() in /home/runner/work/kudu-client-net/kudu-client-net/test/Knet.Kudu.Client.FunctionalTests/ScannerTests.cs:line 227
   at Knet.Kudu.Client.FunctionalTests.ScannerTests.TestKeepAlive() in /home/runner/work/kudu-client-net/kudu-client-net/test/Knet.Kudu.Client.FunctionalTests/ScannerTests.cs:line 227
--- End of stack trace from previous location where exception was thrown ---
[xUnit.net 00:00:46.96]     Knet.Kudu.Client.FunctionalTests.ScannerTests.TestKeepAlive [FAIL]
  Failed Knet.Kudu.Client.FunctionalTests.ScannerTests.TestKeepAlive [45 s]
  Error Message:
   Assert.True() Failure
Expected: True
Actual:   False
  Stack Trace:
     at Knet.Kudu.Client.FunctionalTests.ScannerTests.TestKeepAlive() in /home/runner/work/kudu-client-net/kudu-client-net/test/Knet.Kudu.Client.FunctionalTests/ScannerTests.cs:line 199
   at Knet.Kudu.Client.FunctionalTests.ScannerTests.TestKeepAlive() in /home/runner/work/kudu-client-net/kudu-client-net/test/Knet.Kudu.Client.FunctionalTests/ScannerTests.cs:line 227
   at Knet.Kudu.Client.FunctionalTests.ScannerTests.TestKeepAlive() in /home/runner/work/kudu-client-net/kudu-client-net/test/Knet.Kudu.Client.FunctionalTests/ScannerTests.cs:line 227
--- End of stack trace from previous location where exception was thrown ---

Kudu 1.15 Changes

Issue for tracking changes in the next release of Kudu

  • Regenerate protobuf contracts
  • [c167c1dc39d7089c4b1216bc62e423f3e2638479] - [java] KUDU-3213: try at different server on TABLET_NOT_RUNNING
  • [0e1a1545b827d9a3d5d50fd3d54f60bdea83f40c] - KUDU-2871 support TLSv1.3 in Kudu RPC
  • [e69b3c652d0c21393015aad8e5acd5ece2098573] - KUDU-1884 Make SASL proto name configurable
  • [8e1d5ba4a8af06e82bbdb194393755554ae8e55d] - KUDU-3164: Add table comment support
  • Add support for transactions

Kudu 1.14 Changes

Issue for tracking changes in the next release of Kudu

  • Regenerate protobuf contracts
  • [cc1e091904ceb6b6c527498d8ff849bb42412115] - KUDU-3192: [client] Expose the cluster ID in the client KuduTable
  • [17d569b870e8fb3978a8c02bc1170057a42ca7cc] - [java] KUDU-1563. Add support for UPDATE_IGNORE and DELETE_IGNORE
  • [b2fae6d0aec813c9a82c4cd1cbb3e5d495d6e35a] - [catalog_manager] Status::AlreadyPresent for range duplicates
  • [929cb67da52f9bd30827527bb440b83d2260f608] - KUDU-3205: Fix building scan tokens when tablet not found errors occur

Scanner parser interface

Figure out how scan data should be exposed. Should scan data be exposed incrementally as it's available, or only once it has been buffered (like the Java/C++ clients). Exposing incrementally would slightly reduce latency, but it's more complex. Implementations would also have to be able to handle both Kudu formats (row and columnar).

Current implementation (allows for incremental parsing):

interface IKuduScanParser<T> : IDisposable
{
    T Output { get; }

    void BeginProcessingSidecars(
        KuduSchema scanSchema,
        ScanResponsePB scanResponse,
        KuduSidecarOffsets sidecars);

    void ParseSidecarSegment(ref SequenceReader<byte> reader);
}

IKuduScanParser should be provided by a factory, as if this parser is passed to a scanner, that scanner cannot be cached and reused, due to the implementation of IKuduScanParser mutating internal state.

I wouldn't expect anyone to implement IKuduScanParser, primary motivation of incremental parsing would be for provided helpers, such as a Dapper style simple object mapper, or a ML.NET IDataView generator. In theory, incremental parsing would allow these types to outperform RowResult, as RowResult must be buffered entirely before it can be used.

Possible example of exposing buffered data:

class KuduSidecars : IDisposable
{
    int NumSidecars { get; }
    ReadOnlyMemory<byte> GetSidecarMemory(int sidecar);
    ReadOnlySpan<byte> GetSidecarSpan(int sidecar);
}

Lazily expose sidecars

This option doesn't avoid zero unnecessary copies, but it does allow data to be more lazily streamed than buffering the entire response, and it makes consuming that data significantly easier. KuduRpc would gain the following method:

public virtual void ParseSidecar(KuduSidecar sidecar)
{
}

The scan interface would look something like,

public interface IKuduScanParser<T>
{
    T Output { get; }

    void ProcessScanResponse(KuduSchema scanSchema, ScanResponsePB scanResponse);

    void ProcessSidecar(KuduSidecar sidecar);

    void Reset();
}

Batching RPCs over TLS causes stuck RPCs

Very obscure bug. If 2 RPCs get sent in the same buffer to Socket.WriteAsync(), we only receive the data for the first RPC from Socket.ReceiveAsync(). Both RPCs are received by Kudu, if the client disconnects while waiting for the 2nd RPC response, the server prints this:
W0130 19:40:45.970429 934 connection.cc:554] Connection torn down before Call kudu.master.MasterService.GetTableLocations from 10.0.2.2:51671 (request call id 3) could send its response
The 2nd RPC can be unstuck by sending an additional RPC, suggesting somewhere a buffer isn't being flushed in this scenario.

For now there is a hack-fix in place to prevent multiple RPCs being sent in a single call to Socket.WriteAsync(), at the cost of some efficiency.

TestAuthzTokenExpiration is flaky

This test fails very rarely,

[xUnit.net 00:01:11.12]     Knet.Kudu.Client.FunctionalTests.MultiMasterAuthzTokenTests.TestAuthzTokenExpiration [FAIL]
  X Knet.Kudu.Client.FunctionalTests.MultiMasterAuthzTokenTests.TestAuthzTokenExpiration [36s 99ms]
  Error Message:
   System.OperationCanceledException : Couldn't complete RPC before timeout: Not authorized: authz token verification failure: token expired



   at Knet.Kudu.Client.FunctionalTests.MultiMasterAuthzTokenTests.<>c__DisplayClass6_0.<<TestAuthzTokenExpiration>g__ScanTableAsync|1>d.MoveNext() in /home/runner/work/kudu-client-net/kudu-client-net/test/Knet.Kudu.Client.FunctionalTests/MultiMasterAuthzTokenTests.cs:line 129
--- End of stack trace from previous location where exception was thrown ---
   at Knet.Kudu.Client.FunctionalTests.MultiMasterAuthzTokenTests.TestAuthzTokenExpiration() in /home/runner/work/kudu-client-net/kudu-client-net/test/Knet.Kudu.Client.FunctionalTests/MultiMasterAuthzTokenTests.cs:line 105
--- End of stack trace from previous location where exception was thrown ---
----- Inner Stack Trace -----
   at Knet.Kudu.Client.Connection.KuduConnection.SendReceiveAsync(RequestHeader header, KuduRpc rpc, CancellationToken cancellationToken) in /home/runner/work/kudu-client-net/kudu-client-net/src/Knet.Kudu.Client/Connection/KuduConnection.cs:line 90
   at Knet.Kudu.Client.KuduClient.SendRpcToServerGenericAsync[T](KuduRpc`1 rpc, ServerInfo serverInfo, CancellationToken cancellationToken) in /home/runner/work/kudu-client-net/kudu-client-net/src/Knet.Kudu.Client/KuduClient.cs:line 1232
   at Knet.Kudu.Client.KuduClient.SendRpcToServerGenericAsync[T](KuduRpc`1 rpc, ServerInfo serverInfo, CancellationToken cancellationToken) in /home/runner/work/kudu-client-net/kudu-client-net/src/Knet.Kudu.Client/KuduClient.cs:line 1232
   at Knet.Kudu.Client.KuduClient.SendRpcToTabletAsync[T](KuduTabletRpc`1 rpc, ServerInfo serverInfo, CancellationToken cancellationToken) in /home/runner/work/kudu-client-net/kudu-client-net/src/Knet.Kudu.Client/KuduClient.cs:line 1173
   at Knet.Kudu.Client.KuduClient.SendRpcToTabletAsync[T](KuduTabletRpc`1 rpc, CancellationToken cancellationToken) in /home/runner/work/kudu-client-net/kudu-client-net/src/Knet.Kudu.Client/KuduClient.cs:line 1067
   at Knet.Kudu.Client.KuduClient.SendRpcAsync[T](KuduRpc`1 rpc, CancellationToken cancellationToken)
[xUnit.net 00:01:12.10]     Knet.Kudu.Client.FunctionalTests.MultiMasterAuthzTokenTests.TestAuthzTokenExpiration [FAIL]
  X Knet.Kudu.Client.FunctionalTests.MultiMasterAuthzTokenTests.TestAuthzTokenExpiration [34s 57ms]
  Error Message:
   Assert.Equal() Failure
Expected: 802660
Actual:   802650
  Stack Trace:
     at Knet.Kudu.Client.FunctionalTests.MultiMasterAuthzTokenTests.TestAuthzTokenExpiration() in /home/runner/work/kudu-client-net/kudu-client-net/test/Knet.Kudu.Client.FunctionalTests/MultiMasterAuthzTokenTests.cs:line 107
--- End of stack trace from previous location where exception was thrown ---

It looks timeout related, the test may need updated with a longer timeout.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.