xqrzd / kudu-client-net Goto Github PK
View Code? Open in Web Editor NEW.NET/C# client for Apache Kudu
Home Page: https://kudu.apache.org
License: Apache License 2.0
.NET/C# client for Apache Kudu
Home Page: https://kudu.apache.org
License: Apache License 2.0
Issue for tracking changes needed for the next release of Kudu
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:
Needed for first stable release:
Test Kudu on Windows (.NET Framework + .NET Core). Kudu runs on Windows in docker, that may be a good option.
Setup test matrix with .NET Core (2.1, 3.0), Mono, and Kudu (1.5, 1.6, 1.7.1, 1.8, 1.9).
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.
This will help testing cases that only appear with multiple master/tablet servers.
See https://github.com/apache/kudu/blob/master/java/kudu-client/src/test/java/org/apache/kudu/client/MiniKuduCluster.java
Even the unit tests stall; complete deadlock. Maybe thread pool exhausted? Happens very rarely on CI build.
Some options here, https://blog.marcgravell.com/2018/07/pipe-dreams-part-3.html
Currently option 5 is being used. The parsing code is currently quite messy, and needs simplified.
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)
Issue for tracking changes needed for the next release of Kudu
Issue for tracking changes in the next release of Kudu
Create documentation for using VS Code with WSL 2 to run integration tests
The following TFMs are planned for support:
Required for token authentication
Design: https://github.com/apache/kudu/blob/master/docs/design-docs/rpc.md#step-2-tls-handshake
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 ---
Relies on #4
.NET Core 3 is getting support for hardware intrinsics (SSE/AVX) and has all the instructions needed to copy the C++ client approach, https://github.com/apache/kudu/blob/148a0c7bec6554724339a2235cbd723fb74be339/src/kudu/common/key_encoder.h#L251
Issue for tracking changes in the next release of Kudu
Once dotnet test
works at a solution level, use that instead of specifying each test project.
Issue for tracking changes in the next release of Kudu
See https://issues.apache.org/jira/browse/KUDU-2096 for more info.
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).
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.
class KuduSidecars : IDisposable
{
int NumSidecars { get; }
ReadOnlyMemory<byte> GetSidecarMemory(int sidecar);
ReadOnlySpan<byte> GetSidecarSpan(int sidecar);
}
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();
}
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.
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.
Cloudera hasn't updated http://archive.cloudera.com/kudu/ubuntu/trusty/amd64/kudu/cloudera.list since Kudu1.4. Look into another source, or build a custom package.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.