Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UBSAN issue in a CHECK in MiniTabletServer::bound_rpc_addr() in TestUpdateLagMetrics #10224

Closed
mbautin opened this issue Oct 7, 2021 · 0 comments
Assignees

Comments

@mbautin
Copy link
Contributor

mbautin commented Oct 7, 2021

Noticed this in an Clang 12 ASAN x86_64 AlmaLinux 8 test run of EnableReplicateIntents/CDCServiceTestMultipleServersOneTablet.TestUpdateLagMetrics/0.

Endpoint MiniTabletServer::bound_rpc_addr() const {
  CHECK(started_); // <-- UBSAN fails here: started_ is not a valid boolean value (not 0 or 1).
  return server_->first_rpc_address();
}

The root cause seems to be this loop in cdc_service-int-test.cc, where the leader_mini_tserver and follower_mini_tserver variables are not even being initialized (not sure how our compiler checks missed that):

  ASSERT_OK(WaitFor([&]() -> Result<bool> {
    leader_mini_tserver = nullptr; // THIS LINE WAS MISSING
    follower_mini_tserver = nullptr;  // THIS LINE WAS MISSING
    for (int i = 0; i < cluster_->num_tablet_servers(); i++) {
      std::shared_ptr<tablet::TabletPeer> tablet_peer;
      Status s = cluster_->mini_tablet_server(i)->server()->tablet_manager()->
                 GetTabletPeer(tablet_id, &tablet_peer);
      if (!s.ok()) {
        continue;
      }
      if (tablet_peer->LeaderStatus() == consensus::LeaderStatus::LEADER_AND_READY) {
        leader_mini_tserver = cluster_->mini_tablet_server(i);
      } else {
        follower_mini_tserver = cluster_->mini_tablet_server(i);
      }
    }
    return leader_mini_tserver != nullptr && follower_mini_tserver != nullptr; // THIS IS WHY HERE WE MIGHT END UP WITH VALUES THAT DO NOT MAKE SENSE (ORIGINATING IN DIFFERENT LOOP ITERATIONS OR EVEN CONTAINING INITIAL GARBAGE VALUES).
  }, MonoDelta::FromSeconds(30) * kTimeMultiplier, "Wait for tablet to have a leader."));

Log fragment (have to look carefully for lines starting with #0, #1, etc. to find the UBSAN stack trace):

../../src/yb/tserver/mini_tablet_server.cc:322:3: runtime error: load of value 73, which is not a valid value for type 'bool'
I1007 02:52:00.477190  9616 catalog_manager_bg_tasks.cc:142] Processing pending assignments for table: 140b789602ae42d2afd0524eba59cb56
W1007 02:52:00.476678  9933 async_rpc_tasks.cc:701] Alter Table RPC for tablet 0x0000618000012080 -> 374d2fc99cb04281849d5a0cdb637e4e (table cdc_test_table [id=75724d5bb83e4bb89d25a5f21254b1ea]) (cdc_test_table [id=75724d5bb83e4bb89d25a5f21254b1ea]) (task=0x6130001e0658, state=kRunning): TS 77a12c889a524cfaafc3ad3893b5dfb7 failed: Illegal state (yb/consensus/consensus.cc:113): Not the leader (tablet server error 15) for version 0
I1007 02:52:00.477388  9933 async_rpc_tasks.cc:332] Alter Table RPC for tablet 0x0000618000012080 -> 374d2fc99cb04281849d5a0cdb637e4e (table cdc_test_table [id=75724d5bb83e4bb89d25a5f21254b1ea]) (cdc_test_table [id=75724d5bb83e4bb89d25a5f21254b1ea]) (task=0x6130001e0658, state=kRunning): Scheduling retry with a delay of 45ms (attempt = 2 / 20)...
I1007 02:52:00.505643  9757 tablet_service.cc:1288] Processing CreateTablet for tablet 230b2c341cdb40029c82db4384e15d62 (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0xCA9E, 0xD548)
I1007 02:52:00.505889  9757 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet 230b2c341cdb40029c82db4384e15d62
I1007 02:52:00.508714  9745 tablet_service.cc:1288] Processing CreateTablet for tablet 03eb37b2594f40f8862ec422076576e0 (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0x1554, 0x1FFE)
I1007 02:52:00.508980  9745 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet 03eb37b2594f40f8862ec422076576e0
I1007 02:52:00.509652  9661 tablet_service.cc:1288] Processing CreateTablet for tablet 230b2c341cdb40029c82db4384e15d62 (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0xCA9E, 0xD548)
I1007 02:52:00.509887  9661 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet 230b2c341cdb40029c82db4384e15d62
I1007 02:52:00.511353  9770 tablet_service.cc:1288] Processing CreateTablet for tablet 03eb37b2594f40f8862ec422076576e0 (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0x1554, 0x1FFE)
I1007 02:52:00.512732  9770 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet 03eb37b2594f40f8862ec422076576e0
I1007 02:52:00.514461  9761 tablet_service.cc:1288] Processing CreateTablet for tablet 265a842cb2e3424b844be36901eae544 (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0x0000, 0x0AAA)
I1007 02:52:00.514647  9761 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet 265a842cb2e3424b844be36901eae544
I1007 02:52:00.517882  9691 tablet_service.cc:1288] Processing CreateTablet for tablet 03eb37b2594f40f8862ec422076576e0 (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0x1554, 0x1FFE)
I1007 02:52:00.518157  9691 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet 03eb37b2594f40f8862ec422076576e0
I1007 02:52:00.521746  9660 tablet_service.cc:1288] Processing CreateTablet for tablet 265a842cb2e3424b844be36901eae544 (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0x0000, 0x0AAA)
I1007 02:52:00.521981  9660 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet 265a842cb2e3424b844be36901eae544
I1007 02:52:00.522542  9746 tablet_service.cc:1288] Processing CreateTablet for tablet 230b2c341cdb40029c82db4384e15d62 (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0xCA9E, 0xD548)
I1007 02:52:00.522775  9746 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet 230b2c341cdb40029c82db4384e15d62
W1007 02:52:00.532379  9933 async_rpc_tasks.cc:701] Alter Table RPC for tablet 0x0000618000012080 -> 374d2fc99cb04281849d5a0cdb637e4e (table cdc_test_table [id=75724d5bb83e4bb89d25a5f21254b1ea]) (cdc_test_table [id=75724d5bb83e4bb89d25a5f21254b1ea]) (task=0x6130001e0658, state=kRunning): TS 77a12c889a524cfaafc3ad3893b5dfb7 failed: Illegal state (yb/consensus/consensus.cc:113): Not the leader (tablet server error 15) for version 0
I1007 02:52:00.532770  9933 async_rpc_tasks.cc:332] Alter Table RPC for tablet 0x0000618000012080 -> 374d2fc99cb04281849d5a0cdb637e4e (table cdc_test_table [id=75724d5bb83e4bb89d25a5f21254b1ea]) (cdc_test_table [id=75724d5bb83e4bb89d25a5f21254b1ea]) (task=0x6130001e0658, state=kRunning): Scheduling retry with a delay of 77ms (attempt = 3 / 20)...
    #0 0x7f3a833db504 in yb::tserver::MiniTabletServer::bound_rpc_addr() const /nfusr/alma8-gcp-cloud/jenkins-worker-m412f1/jenkins/jenkins-github-yugabyte-db-phabricator-124989/build/asan-clang12-dynamic-ninja/../../src/yb/tserver/mini_tablet_server.cc:322:3
I1007 02:52:00.534577  9692 tablet_service.cc:1288] Processing CreateTablet for tablet 2df9ff42f9e04a38857ad04919bc6c87 (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0x7FF8, 0x8AA2)
I1007 02:52:00.534834  9692 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet 2df9ff42f9e04a38857ad04919bc6c87
I1007 02:52:00.540032  9777 tablet_service.cc:1288] Processing CreateTablet for tablet 3bd34fc4b35e4f1fa9c5a6fd80fedc0b (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0x4AA6, 0x5550)
I1007 02:52:00.540289  9777 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet 3bd34fc4b35e4f1fa9c5a6fd80fedc0b
I1007 02:52:00.543447  9764 tablet_service.cc:1288] Processing CreateTablet for tablet 3d56260809c9427b90d54b1736c85ea0 (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0x954C, 0x9FF6)
I1007 02:52:00.543728  9764 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet 3d56260809c9427b90d54b1736c85ea0
I1007 02:52:00.544517  9693 tablet_service.cc:1288] Processing CreateTablet for tablet 3bd34fc4b35e4f1fa9c5a6fd80fedc0b (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0x4AA6, 0x5550)
I1007 02:52:00.544586  9750 tablet_service.cc:1288] Processing CreateTablet for tablet 2df9ff42f9e04a38857ad04919bc6c87 (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0x7FF8, 0x8AA2)
I1007 02:52:00.544798  9693 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet 3bd34fc4b35e4f1fa9c5a6fd80fedc0b
I1007 02:52:00.544874  9750 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet 2df9ff42f9e04a38857ad04919bc6c87
I1007 02:52:00.545521  9787 tablet_service.cc:1288] Processing CreateTablet for tablet 2df9ff42f9e04a38857ad04919bc6c87 (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0x7FF8, 0x8AA2)
I1007 02:52:00.545795  9787 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet 2df9ff42f9e04a38857ad04919bc6c87
I1007 02:52:00.548840  9684 tablet_service.cc:1288] Processing CreateTablet for tablet 265a842cb2e3424b844be36901eae544 (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0x0000, 0x0AAA)
I1007 02:52:00.549147  9684 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet 265a842cb2e3424b844be36901eae544
I1007 02:52:00.551683  9751 tablet_service.cc:1288] Processing CreateTablet for tablet 3d56260809c9427b90d54b1736c85ea0 (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0x954C, 0x9FF6)
I1007 02:52:00.551964  9751 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet 3d56260809c9427b90d54b1736c85ea0
I1007 02:52:00.556684  9753 tablet_service.cc:1288] Processing CreateTablet for tablet 3bd34fc4b35e4f1fa9c5a6fd80fedc0b (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0x4AA6, 0x5550)
I1007 02:52:00.556933  9753 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet 3bd34fc4b35e4f1fa9c5a6fd80fedc0b
I1007 02:52:00.560871  9767 tablet_service.cc:1288] Processing CreateTablet for tablet 3d56260809c9427b90d54b1736c85ea0 (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0x954C, 0x9FF6)
I1007 02:52:00.561146  9767 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet 3d56260809c9427b90d54b1736c85ea0
I1007 02:52:00.565884  9749 tablet_service.cc:1288] Processing CreateTablet for tablet 492c2303c9fa4af188da929d99a924a2 (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0x5550, 0x5FFA)
I1007 02:52:00.566164  9749 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet 492c2303c9fa4af188da929d99a924a2
I1007 02:52:00.566311  9780 tablet_service.cc:1288] Processing CreateTablet for tablet 561fefedfef34936ba1e42241ed354ab (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0x754E, 0x7FF8)
I1007 02:52:00.566547  9780 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet 561fefedfef34936ba1e42241ed354ab
I1007 02:52:00.567654  9747 tablet_service.cc:1288] Processing CreateTablet for tablet 561fefedfef34936ba1e42241ed354ab (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0x754E, 0x7FF8)
I1007 02:52:00.567901  9747 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet 561fefedfef34936ba1e42241ed354ab
I1007 02:52:00.565884  9775 tablet_service.cc:1288] Processing CreateTablet for tablet 492c2303c9fa4af188da929d99a924a2 (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0x5550, 0x5FFA)
I1007 02:52:00.569797  9775 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet 492c2303c9fa4af188da929d99a924a2
I1007 02:52:00.572055  9776 tablet_service.cc:1288] Processing CreateTablet for tablet 492c2303c9fa4af188da929d99a924a2 (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0x5550, 0x5FFA)
I1007 02:52:00.572336  9776 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet 492c2303c9fa4af188da929d99a924a2
I1007 02:52:00.572471  9756 tablet_service.cc:1288] Processing CreateTablet for tablet 668062f6d8a24108a883aca5449014f8 (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0xDFF2, 0xEA9C)
I1007 02:52:00.573308  9756 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet 668062f6d8a24108a883aca5449014f8
I1007 02:52:00.573997  9774 tablet_service.cc:1288] Processing CreateTablet for tablet 561fefedfef34936ba1e42241ed354ab (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0x754E, 0x7FF8)
I1007 02:52:00.574287  9774 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet 561fefedfef34936ba1e42241ed354ab
I1007 02:52:00.579385  9790 tablet_service.cc:1288] Processing CreateTablet for tablet 668062f6d8a24108a883aca5449014f8 (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0xDFF2, 0xEA9C)
I1007 02:52:00.579619  9790 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet 668062f6d8a24108a883aca5449014f8
I1007 02:52:00.584089  9781 tablet_service.cc:1288] Processing CreateTablet for tablet 668062f6d8a24108a883aca5449014f8 (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0xDFF2, 0xEA9C)
I1007 02:52:00.585096  9755 tablet_service.cc:1288] Processing CreateTablet for tablet 959213d7215e4542abd9099e38d89590 (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0xAAA0, 0xB54A)
I1007 02:52:00.585315  9755 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet 959213d7215e4542abd9099e38d89590
I1007 02:52:00.585971  9781 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet 668062f6d8a24108a883aca5449014f8
    #1 0x4618ad in yb::cdc::CDCServiceTestMultipleServersOneTablet_TestUpdateLagMetrics_Test::TestBody() /nfusr/alma8-gcp-cloud/jenkins-worker-m412f1/jenkins/jenkins-github-yugabyte-db-phabricator-124989/build/asan-clang12-dynamic-ninja/../../ent/src/yb/integration-tests/cdc_service-int-test.cc:779:56
I1007 02:52:00.587330  9758 tablet_service.cc:1288] Processing CreateTablet for tablet 959213d7215e4542abd9099e38d89590 (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0xAAA0, 0xB54A)
I1007 02:52:00.587615  9758 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet 959213d7215e4542abd9099e38d89590
I1007 02:52:00.591555  9785 tablet_service.cc:1288] Processing CreateTablet for tablet 959213d7215e4542abd9099e38d89590 (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0xAAA0, 0xB54A)
I1007 02:52:00.591781  9785 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet 959213d7215e4542abd9099e38d89590
I1007 02:52:00.595858  9805 tablet_service.cc:1288] Processing CreateTablet for tablet 9bf5a8dff0a048acbce5ff518bbc74b2 (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0x9FF6, 0xAAA0)
I1007 02:52:00.596140  9805 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet 9bf5a8dff0a048acbce5ff518bbc74b2
I1007 02:52:00.598511  9765 tablet_service.cc:1288] Processing CreateTablet for tablet 9bf5a8dff0a048acbce5ff518bbc74b2 (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0x9FF6, 0xAAA0)
I1007 02:52:00.598800  9765 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet 9bf5a8dff0a048acbce5ff518bbc74b2
I1007 02:52:00.600132  9760 tablet_service.cc:1288] Processing CreateTablet for tablet 9bf5a8dff0a048acbce5ff518bbc74b2 (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0x9FF6, 0xAAA0)
I1007 02:52:00.600370  9760 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet 9bf5a8dff0a048acbce5ff518bbc74b2
I1007 02:52:00.600404  9766 tablet_service.cc:1288] Processing CreateTablet for tablet a4c011be7fbc4d13ac109d0fcc20aed2 (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0xF546, 0xFFFF)
I1007 02:52:00.601101  9766 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet a4c011be7fbc4d13ac109d0fcc20aed2
I1007 02:52:00.606571  9796 tablet_service.cc:1288] Processing CreateTablet for tablet a4c011be7fbc4d13ac109d0fcc20aed2 (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0xF546, 0xFFFF)
I1007 02:52:00.606676  9771 tablet_service.cc:1288] Processing CreateTablet for tablet b3e45014652944bda9b4e2fd93a3afdf (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0x0AAA, 0x1554)
I1007 02:52:00.606797  9796 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet a4c011be7fbc4d13ac109d0fcc20aed2
I1007 02:52:00.606953  9771 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet b3e45014652944bda9b4e2fd93a3afdf
I1007 02:52:00.608155  9784 tablet_service.cc:1288] Processing CreateTablet for tablet b3e45014652944bda9b4e2fd93a3afdf (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0x0AAA, 0x1554)
I1007 02:52:00.608428  9784 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet b3e45014652944bda9b4e2fd93a3afdf
I1007 02:52:00.609071  9759 tablet_service.cc:1288] Processing CreateTablet for tablet a4c011be7fbc4d13ac109d0fcc20aed2 (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0xF546, 0xFFFF)
I1007 02:52:00.609321  9759 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet a4c011be7fbc4d13ac109d0fcc20aed2
I1007 02:52:00.612246  9877 raft_consensus.cc:1010] T 0c6856af47fc4ab292913f6d9ffe0698 P 77a12c889a524cfaafc3ad3893b5dfb7 [term 1 FOLLOWER]: ReportFailDetected: Starting NORMAL_ELECTION...
I1007 02:52:00.612336  9877 raft_consensus.cc:610] T 0c6856af47fc4ab292913f6d9ffe0698 P 77a12c889a524cfaafc3ad3893b5dfb7 [term 1 FOLLOWER]: Fail of leader 6b2fad6b9daf4039ba4f5a4b9578ea7a detected. Triggering leader pre-election, mode=NORMAL_ELECTION
I1007 02:52:00.612402  9877 raft_consensus.cc:3232] T 0c6856af47fc4ab292913f6d9ffe0698 P 77a12c889a524cfaafc3ad3893b5dfb7 [term 1 FOLLOWER]: Snoozing leader timeout detection for 3.087s
I1007 02:52:00.612463  9877 raft_consensus.cc:654] T 0c6856af47fc4ab292913f6d9ffe0698 P 77a12c889a524cfaafc3ad3893b5dfb7 [term 1 FOLLOWER]: Starting pre-election with config: opid_index: -1 peers { permanent_uuid: "6b2fad6b9daf4039ba4f5a4b9578ea7a" member_type: VOTER last_known_private_addr { host: "127.0.0.4" port: 16539 } last_known_broadcast_addr { host: "127.0.0.5.ip.yugabyte" port: 16539 } cloud_info { placement_cloud: "cloud1" placement_region: "rack2" placement_zone: "zone" } } peers { permanent_uuid: "77a12c889a524cfaafc3ad3893b5dfb7" member_type: VOTER last_known_private_addr { host: "127.0.0.2" port: 25421 } last_known_broadcast_addr { host: "127.0.0.3.ip.yugabyte" port: 25421 } cloud_info { placement_cloud: "cloud1" placement_region: "rack1" placement_zone: "zone" } } peers { permanent_uuid: "6149baf9fbae48ada8cef8c0390e6e4b" member_type: VOTER last_known_private_addr { host: "127.0.0.6" port: 25660 } last_known_broadcast_addr { host: "127.0.0.7.ip.yugabyte" port: 25660 } cloud_info { placement_cloud: "cloud2" placement_region: "rack3" placement_zone: "zone" } }
I1007 02:52:00.613308  9877 leader_election.cc:215] T 0c6856af47fc4ab292913f6d9ffe0698 P 77a12c889a524cfaafc3ad3893b5dfb7 [CANDIDATE]: Term 2 pre-election: Requesting vote from peer 6b2fad6b9daf4039ba4f5a4b9578ea7a
I1007 02:52:00.615061  9754 tablet_service.cc:1288] Processing CreateTablet for tablet cb7a6e1329234e20ac8fffacc1368c02 (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0xD548, 0xDFF2)
I1007 02:52:00.615312  9754 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet cb7a6e1329234e20ac8fffacc1368c02
I1007 02:52:00.616726  9877 leader_election.cc:215] T 0c6856af47fc4ab292913f6d9ffe0698 P 77a12c889a524cfaafc3ad3893b5dfb7 [CANDIDATE]: Term 2 pre-election: Requesting vote from peer 6149baf9fbae48ada8cef8c0390e6e4b
    #2 0x7f3a5ed37007 in void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211004174329-4e50c6e022-almalinux8-x86_64-clang12/src/gmock-1.8.0/googletest/src/gtest.cc:2402:10
    #3 0x7f3a5ed37007 in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211004174329-4e50c6e022-almalinux8-x86_64-clang12/src/gmock-1.8.0/googletest/src/gtest.cc:2438:14
I1007 02:52:00.617677  9869 raft_consensus.cc:2349] T 0c6856af47fc4ab292913f6d9ffe0698 P 6b2fad6b9daf4039ba4f5a4b9578ea7a [term 2 FOLLOWER]: Pre-election. Granting vote for candidate 77a12c889a524cfaafc3ad3893b5dfb7 in term 2
I1007 02:52:00.617731  9894 raft_consensus.cc:2763] T 0c6856af47fc4ab292913f6d9ffe0698 P 6149baf9fbae48ada8cef8c0390e6e4b [term 2 FOLLOWER]:  Leader pre-election vote request: Denying vote to candidate 77a12c889a524cfaafc3ad3893b5dfb7 in current term 2: Already voted for candidate 6149baf9fbae48ada8cef8c0390e6e4b in this term.
I1007 02:52:00.618310  9810 tablet_service.cc:1288] Processing CreateTablet for tablet cb7a6e1329234e20ac8fffacc1368c02 (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0xD548, 0xDFF2)
I1007 02:52:00.618461  9762 tablet_service.cc:1288] Processing CreateTablet for tablet cd84966833f9497fa41d85d018da0d73 (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0x3FFC, 0x4AA6)
I1007 02:52:00.618573  9810 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet cb7a6e1329234e20ac8fffacc1368c02
I1007 02:52:00.618621  9843 leader_election.cc:366] T 0c6856af47fc4ab292913f6d9ffe0698 P 77a12c889a524cfaafc3ad3893b5dfb7 [CANDIDATE]: Term 2 pre-election: Vote granted by peer 6b2fad6b9daf4039ba4f5a4b9578ea7a
I1007 02:52:00.618700  9843 leader_election.cc:241] T 0c6856af47fc4ab292913f6d9ffe0698 P 77a12c889a524cfaafc3ad3893b5dfb7 [CANDIDATE]: Term 2 pre-election: Election decided. Result: candidate won.
I1007 02:52:00.618734  9762 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet cd84966833f9497fa41d85d018da0d73
I1007 02:52:00.618980  9844 raft_consensus.cc:3232] T 0c6856af47fc4ab292913f6d9ffe0698 P 77a12c889a524cfaafc3ad3893b5dfb7 [term 1 FOLLOWER]: Snoozing leader timeout detection for 3.236s
I1007 02:52:00.619102  9844 raft_consensus.cc:3125] T 0c6856af47fc4ab292913f6d9ffe0698 P 77a12c889a524cfaafc3ad3893b5dfb7 [term 1 FOLLOWER]: Leader pre-election won for term 2
I1007 02:52:00.619169  9844 raft_consensus.cc:610] T 0c6856af47fc4ab292913f6d9ffe0698 P 77a12c889a524cfaafc3ad3893b5dfb7 [term 1 FOLLOWER]: Fail of leader 6b2fad6b9daf4039ba4f5a4b9578ea7a detected. Triggering leader election, mode=NORMAL_ELECTION
I1007 02:52:00.619233  9844 raft_consensus.cc:3232] T 0c6856af47fc4ab292913f6d9ffe0698 P 77a12c889a524cfaafc3ad3893b5dfb7 [term 1 FOLLOWER]: Snoozing leader timeout detection for 3.266s
I1007 02:52:00.619294  9844 raft_consensus.cc:3293] T 0c6856af47fc4ab292913f6d9ffe0698 P 77a12c889a524cfaafc3ad3893b5dfb7 [term 1 FOLLOWER]: Advancing to term 2
W1007 02:52:00.621366  9934 async_rpc_tasks.cc:701] Alter Table RPC for tablet 0x0000618000012080 -> 374d2fc99cb04281849d5a0cdb637e4e (table cdc_test_table [id=75724d5bb83e4bb89d25a5f21254b1ea]) (cdc_test_table [id=75724d5bb83e4bb89d25a5f21254b1ea]) (task=0x6130001e0658, state=kRunning): TS 77a12c889a524cfaafc3ad3893b5dfb7 failed: Illegal state (yb/consensus/consensus.cc:113): Not the leader (tablet server error 15) for version 0
I1007 02:52:00.621793  9934 async_rpc_tasks.cc:332] Alter Table RPC for tablet 0x0000618000012080 -> 374d2fc99cb04281849d5a0cdb637e4e (table cdc_test_table [id=75724d5bb83e4bb89d25a5f21254b1ea]) (cdc_test_table [id=75724d5bb83e4bb89d25a5f21254b1ea]) (task=0x6130001e0658, state=kRunning): Scheduling retry with a delay of 141ms (attempt = 4 / 20)...
I1007 02:52:00.622628  9804 tablet_service.cc:1288] Processing CreateTablet for tablet b3e45014652944bda9b4e2fd93a3afdf (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0x0AAA, 0x1554)
I1007 02:52:00.622659  9791 tablet_service.cc:1288] Processing CreateTablet for tablet cb7a6e1329234e20ac8fffacc1368c02 (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0xD548, 0xDFF2)
I1007 02:52:00.622880  9804 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet b3e45014652944bda9b4e2fd93a3afdf
    #4 0x7f3a5ecf7c8f in testing::Test::Run() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211004174329-4e50c6e022-almalinux8-x86_64-clang12/src/gmock-1.8.0/googletest/src/gtest.cc:2474:5
    #5 0x7f3a5ecf9c7b in testing::TestInfo::Run() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211004174329-4e50c6e022-almalinux8-x86_64-clang12/src/gmock-1.8.0/googletest/src/gtest.cc:2656:11
    #6 0x7f3a5ecfb9c5 in testing::TestCase::Run() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211004174329-4e50c6e022-almalinux8-x86_64-clang12/src/gmock-1.8.0/googletest/src/gtest.cc:2774:28
I1007 02:52:00.623975  9791 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet cb7a6e1329234e20ac8fffacc1368c02
    #7 0x7f3a5ed103e7 in testing::internal::UnitTestImpl::RunAllTests() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211004174329-4e50c6e022-almalinux8-x86_64-clang12/src/gmock-1.8.0/googletest/src/gtest.cc:4649:43
    #8 0x7f3a5ed3ccd6 in bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211004174329-4e50c6e022-almalinux8-x86_64-clang12/src/gmock-1.8.0/googletest/src/gtest.cc:2402:10
    #9 0x7f3a5ed3ccd6 in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211004174329-4e50c6e022-almalinux8-x86_64-clang12/src/gmock-1.8.0/googletest/src/gtest.cc:2438:14
    #10 0x7f3a5ed0eacc in testing::UnitTest::Run() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211004174329-4e50c6e022-almalinux8-x86_64-clang12/src/gmock-1.8.0/googletest/src/gtest.cc:4257:10
    #11 0x7f3a8e454ddd in RUN_ALL_TESTS() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211004174329-4e50c6e022-almalinux8-x86_64-clang12/installed/asan/include/gtest/gtest.h:2233:46
    #12 0x7f3a8e4543d9 in main /nfusr/alma8-gcp-cloud/jenkins-worker-m412f1/jenkins/jenkins-github-yugabyte-db-phabricator-124989/build/asan-clang12-dynamic-ninja/../../src/yb/util/test_main.cc:104:13
I1007 02:52:00.626572  9808 tablet_service.cc:1288] Processing CreateTablet for tablet cd84966833f9497fa41d85d018da0d73 (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0x3FFC, 0x4AA6)
I1007 02:52:00.626756  9808 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet cd84966833f9497fa41d85d018da0d73
I1007 02:52:00.627686  9779 tablet_service.cc:1288] Processing CreateTablet for tablet cd84966833f9497fa41d85d018da0d73 (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0x3FFC, 0x4AA6)
I1007 02:52:00.627902  9779 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet cd84966833f9497fa41d85d018da0d73
I1007 02:52:00.630719  9788 tablet_service.cc:1288] Processing CreateTablet for tablet d5233a6792934769ac68be9077409946 (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0x5FFA, 0x6AA4)
I1007 02:52:00.630981  9788 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet d5233a6792934769ac68be9077409946
I1007 02:52:00.632243  9786 tablet_service.cc:1288] Processing CreateTablet for tablet d5233a6792934769ac68be9077409946 (table=cdc_state [id=140b789602ae42d2afd0524eba59cb56]), partition=hash_split: [0x5FFA, 0x6AA4)
I1007 02:52:00.632486  9786 ts_tablet_manager.cc:2068] Get and update data/wal directory assignment map for table: 140b789602ae42d2afd0524eba59cb56 and tablet d5233a6792934769ac68be9077409946
    #13 0x7f3a5de98492 in __libc_start_main (/lib64/libc.so.6+0x23492)
    #14 0x449d9d in _start (/nfusr/alma8-gcp-cloud/jenkins-worker-m412f1/jenkins/jenkins-github-yugabyte-db-phabricator-124989/build/asan-clang12-dynamic-ninja/tests-integration-tests/cdc_service-int-test+0x449d9d)

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../../src/yb/tserver/mini_tablet_server.cc:322:3 in 
@mbautin mbautin self-assigned this Oct 7, 2021
mbautin added a commit to mbautin/yugabyte-db that referenced this issue Oct 30, 2021
…ugabyte#10230] [yugabyte#10251] [yugabyte#10295] Enable Clang 12 ASAN build on AlmaLinux 8 and fix relevant bugs

Summary:
Enabling the Clang 12 ASAN build on AlmaLinux 8 and fixing these bugs from that build:
- yugabyte#7092 - pick up an updated version of LLVM where libunwind has been patched to work around crashing with an unknown x86_64 register error.
- yugabyte#10046 - suppress harmless undefined behavior in gflags.cc.
- yugabyte#10222 - increase the timeout for waiting for tablet server registration in mini cluster.
- yugabyte#10224 - when looping to wait for leader/follower of a tablet in TestUpdateLagMetrics, reset tablet server pointers to nullptr at every iteration.
- yugabyte#10230, yugabyte#10251 - use posix_spawn on Linux to create subprocesses to avoid getting stuck in the child process when allocating memory when setting environment variables because some memory allocation lock is already held by the parent process. On macOS, we still use fork+exec because posix_spawnp throws errors related to closing file descriptors. Making sure all files in our code are opened with FD_CLOEXEC is out of scope of this revision, and will be addressed by yugabyte#10321.
- yugabyte#10295 - fix undefined behavior (adding to a null pointer) in a Postgres sorting function.

Also removing Clang 7 ASAN build on CentOS 7 from Jenkins (we don't need two ASAN builds).

Test Plan: Jenkins

Reviewers: bogdan, steve.varnau, sergei

Reviewed By: sergei

Subscribers: ybase

Differential Revision: https://phabricator.dev.yugabyte.com/D13301
mbautin added a commit that referenced this issue Oct 30, 2021
…Clang 12 ASAN build on AlmaLinux 8 and fix relevant bugs

Summary:
Updating third-party dependencies from 44ba3719652858e1f7816df87b25101e09527c88 to 2d282c38cfcbc10af7bdc1c86bf1e8af88f36efd (updating the LLVM toolchain with a bug fix, and also picking up the program_options Boost library addition by @mikhpolitov, commit yugabyte/yugabyte-db-thirdparty@2d282c3).

yugabyte-db-thirdparty diff link:
https://github.com/yugabyte/yugabyte-db-thirdparty/compare/44ba3719652858e1f7816df87b25101e09527c88..2d282c38cfcbc10af7bdc1c86bf1e8af88f36efd

Enabling the Clang 12 ASAN build on AlmaLinux 8 and fixing these bugs from that build:
- #7092 - pick up an updated version of LLVM where libunwind has been patched to work around crashing with an unknown x86_64 register error.
- #10046 - suppress harmless undefined behavior in gflags.cc.
- #10222 - increase the timeout for waiting for tablet server registration in mini cluster.
- #10224 - when looping to wait for leader/follower of a tablet in TestUpdateLagMetrics, reset tablet server pointers to nullptr at every iteration.
- #10230, #10251 - use posix_spawn on Linux to create subprocesses to avoid getting stuck in the child process when allocating memory when setting environment variables because some memory allocation lock is already held by the parent process. On macOS, we still use fork+exec because posix_spawnp throws errors related to closing file descriptors. Making sure all files in our code are opened with FD_CLOEXEC is out of scope of this revision, and will be addressed by #10321.
- #10295 - fix undefined behavior (adding to a null pointer) in a Postgres sorting function.
- Fix HostPort& field type in ysql_upgrade.h (make it HostPort). Otherwise there is an ASAN issue accessing a deallocated stack value. (No separate GitHub issue for this bug.)

Also consolidating Status generation from a C standard library error number in errno.h and errno.c, and adding a few utility macros for convenient invocation of C functions that either return an errno as the return value, or return zero vs. non zero depending on whether there is an error, and set errno as a side effect.

As part of this diff, we are removing Clang 7 ASAN build on CentOS 7 from Jenkins (we don't need two different ASAN builds).

Test Plan: Jenkins

Reviewers: bogdan, steve.varnau, sergei

Reviewed By: sergei

Subscribers: ybase

Differential Revision: https://phabricator.dev.yugabyte.com/D13301
@mbautin mbautin closed this as completed Oct 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant