[ 
https://issues.apache.org/jira/browse/KUDU-3248?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17727789#comment-17727789
 ] 

ASF subversion and git services commented on KUDU-3248:
-------------------------------------------------------

Commit 78578eda81f6d375f08146af4033581528f3e327 in kudu's branch 
refs/heads/branch-1.17.x from Alexey Serbin
[ https://gitbox.apache.org/repos/asf?p=kudu.git;h=78578eda8 ]

KUDU-3248 improve replica selection initialization

Since the original implementation stored the random choice for replica
selection integer in a variable that was initialized statically, the
corresponding calls to libstdc++/libc++ runtime had been issued before
the process called the main() function.  That means some SSE4.2-specific
instructions might be called since libkudu_client is unconditionally
compiled with -msse4.2 flag, and there'd been no chance to call
KuduClientBuilder::Build() that would verify the required features are
present by calling CheckCPUFlags().  As a result, an attempt to run
an application linked with kudu_client library at a machine lacking
SSE4.2 support would result in a crash with SIGILL signal and a stack
trace like below:

  #0  0x00007fc4b1b58162 in std::mersenne_twister_engine<...>::_M_gen_rand
      at include/c++/7.5.0/bits/random.tcc:408
  #1  std::mersenne_twister_engine<...>::operator()
      at include/c++/7.5.0/bits/random.tcc:459
  #2  0x00007fc4b1b1d65d in kudu::client::(anonymous 
namespace)::InitRandomSelectionInt
      at ../../../../../src/kudu/client/client-internal.cc:196
  #3  0x00007fc4b1b1d6ef in __static_initialization_and_destruction_0
      at ../../../../../src/kudu/client/client-internal.cc:198
  #4  _GLOBAL__sub_I_client_internal.cc(void)
      at ../../../../../src/kudu/client/client-internal.cc:871

This patch addresses that deficiency, so now instead of unexpectedly
crashing, the application would return an error upon at attempt to
create an instance of KuduClient object.

This is a follow-up to ccbbfb3006314f2c37f3a40bfec355db9fc90e02.

Change-Id: I11c2a29ef69a8c97c68330d261fdff64accebb0b
Reviewed-on: http://gerrit.cloudera.org:8080/19828
Reviewed-by: Abhishek Chennaka <[email protected]>
Reviewed-by: Wenzhe Zhou <[email protected]>
Tested-by: Alexey Serbin <[email protected]>
Reviewed-on: http://gerrit.cloudera.org:8080/19948
Reviewed-by: Yingchun Lai <[email protected]>
Tested-by: Kudu Jenkins
Reviewed-by: Yuqi Du <[email protected]>
Reviewed-by: Yifan Zhang <[email protected]>


> Expose replica selection option that provides better affinity for remote scans
> ------------------------------------------------------------------------------
>
>                 Key: KUDU-3248
>                 URL: https://issues.apache.org/jira/browse/KUDU-3248
>             Project: Kudu
>          Issue Type: Improvement
>          Components: client
>            Reporter: David Rorke
>            Assignee: Grant Henke
>            Priority: Major
>             Fix For: 1.15.0
>
>
> Kudu clients like Impala that use the CLOSEST_REPLICA selection option can 
> suffer from bad tserver buffer cache warmup/locality during remote scans due 
> to lack of tserver affinity as described in IMPALA-10481.
> The Kudu client should expose a replica selection option that provides better 
> affinity when doing remote scans.   The comments in IMPALA-10481 suggest a 
> new LOCAL_OR_LEADER option that would select a local replica if one exists, 
> otherwise fallback to the leader.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to