Skip to content

ARROW-14211: [C++][Compute] Fixing thread sanitizer problems in hash join node - #11350

Closed
michalursa wants to merge 1 commit into
apache:masterfrom
michalursa:ARROW-14211-hash-join-tsan
Closed

ARROW-14211: [C++][Compute] Fixing thread sanitizer problems in hash join node#11350
michalursa wants to merge 1 commit into
apache:masterfrom
michalursa:ARROW-14211-hash-join-tsan

Conversation

@michalursa

Copy link
Copy Markdown
Contributor

Fixing 3 issues:

  • one in SchemaProjectionMaps - I simplified all of the code to get rid of thread synchronization at all
  • one in TaskScheduler - added (unnecessary) mutex
  • one in HashJoinImpl - switching from shared byte vector to local bit vectors and merge (for recording if a match for a hash table row has been seen)

@michalursa

Copy link
Copy Markdown
ContributorAuthor

@github-actions crossbow submit -g cpp

@github-actions

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

Revision: 16ded42dddc5e654dd177707c1c47dd6d8005c0d

Submitted crossbow builds: ursacomputing/crossbow @ actions-902

TaskStatus
test-conda-cppGithub Actions
test-conda-cpp-valgrindAzure
test-debian-11-cppGithub Actions
test-fedora-33-cppGithub Actions
test-ubuntu-18.04-cppGithub Actions
test-ubuntu-18.04-cpp-releaseGithub Actions
test-ubuntu-18.04-cpp-staticGithub Actions
test-ubuntu-20.04-cppGithub Actions
test-ubuntu-20.04-cpp-14Github Actions
test-ubuntu-20.04-cpp-17Github Actions
test-ubuntu-20.04-cpp-thread-sanitizerGithub Actions

@michalursa
michalursaforce-pushed the ARROW-14211-hash-join-tsan branch from 16ded42 to 9682388CompareOctober 7, 2021 04:47
@michalursa

Copy link
Copy Markdown
ContributorAuthor

@github-actions crossbow submit -g cpp

@github-actions

Copy link
Copy Markdown

Revision: 96823881bfd42876dfbcc577415a1870611fee25

Submitted crossbow builds: ursacomputing/crossbow @ actions-903

TaskStatus
test-conda-cppGithub Actions
test-conda-cpp-valgrindAzure
test-debian-11-cppGithub Actions
test-fedora-33-cppGithub Actions
test-ubuntu-18.04-cppGithub Actions
test-ubuntu-18.04-cpp-releaseGithub Actions
test-ubuntu-18.04-cpp-staticGithub Actions
test-ubuntu-20.04-cppGithub Actions
test-ubuntu-20.04-cpp-14Github Actions
test-ubuntu-20.04-cpp-17Github Actions
test-ubuntu-20.04-cpp-thread-sanitizerGithub Actions

@pitrou
pitrou requested a review from bkietzOctober 7, 2021 07:42
Comment threadcpp/src/arrow/compute/exec/tpch_test.cc Outdated
Comment threadcpp/src/arrow/compute/exec/tpch_test.cc Outdated
@michalursamichalursa changed the title ARROW-14197: [C++][Compute] Fixing thread sanitizer problems in hash join nodeARROW-14211: [C++][Compute] Fixing thread sanitizer problems in hash join nodeOct 7, 2021
@github-actions

Copy link
Copy Markdown

@michalursa
michalursaforce-pushed the ARROW-14211-hash-join-tsan branch from 9682388 to 7c80dbdCompareOctober 7, 2021 19:17
@michalursa

Copy link
Copy Markdown
ContributorAuthor

@github-actions crossbow submit -g cpp

@github-actions

Copy link
Copy Markdown

Revision: 679309bb681dd4e40caf5cccf608a867d97f3add

Submitted crossbow builds: ursacomputing/crossbow @ actions-908

TaskStatus
test-conda-cppGithub Actions
test-conda-cpp-valgrindAzure
test-debian-11-cppGithub Actions
test-fedora-33-cppGithub Actions
test-ubuntu-18.04-cppGithub Actions
test-ubuntu-18.04-cpp-releaseGithub Actions
test-ubuntu-18.04-cpp-staticGithub Actions
test-ubuntu-20.04-cppGithub Actions
test-ubuntu-20.04-cpp-14Github Actions
test-ubuntu-20.04-cpp-17Github Actions
test-ubuntu-20.04-cpp-thread-sanitizerGithub Actions

@michalursa
michalursaforce-pushed the ARROW-14211-hash-join-tsan branch from 679309b to 3c32de9CompareOctober 11, 2021 10:06
@michalursa

Copy link
Copy Markdown
ContributorAuthor

@github-actions crossbow submit -g cpp

@github-actions

Copy link
Copy Markdown

Revision: 3c32de96b05171c126d1cf5e08ce019eaedb244f

Submitted crossbow builds: ursacomputing/crossbow @ actions-910

TaskStatus
test-conda-cppGithub Actions
test-conda-cpp-valgrindAzure
test-debian-11-cppGithub Actions
test-fedora-33-cppGithub Actions
test-ubuntu-18.04-cppGithub Actions
test-ubuntu-18.04-cpp-releaseGithub Actions
test-ubuntu-18.04-cpp-staticGithub Actions
test-ubuntu-20.04-cppGithub Actions
test-ubuntu-20.04-cpp-14Github Actions
test-ubuntu-20.04-cpp-17Github Actions
test-ubuntu-20.04-cpp-thread-sanitizerGithub Actions

@michalursa
michalursaforce-pushed the ARROW-14211-hash-join-tsan branch from 3c32de9 to f1dae79CompareOctober 11, 2021 21:44
@michalursa

Copy link
Copy Markdown
ContributorAuthor

@github-actions crossbow submit -g cpp

@github-actions

Copy link
Copy Markdown

Revision: f1dae79664dc0be394e0544b62ef79d7e1e34685

Submitted crossbow builds: ursacomputing/crossbow @ actions-914

TaskStatus
test-conda-cppGithub Actions
test-conda-cpp-valgrindAzure
test-debian-11-cppGithub Actions
test-fedora-33-cppGithub Actions
test-ubuntu-18.04-cppGithub Actions
test-ubuntu-18.04-cpp-releaseGithub Actions
test-ubuntu-18.04-cpp-staticGithub Actions
test-ubuntu-20.04-cppGithub Actions
test-ubuntu-20.04-cpp-14Github Actions
test-ubuntu-20.04-cpp-17Github Actions
test-ubuntu-20.04-cpp-thread-sanitizerGithub Actions

@michalursa
michalursaforce-pushed the ARROW-14211-hash-join-tsan branch from f1dae79 to 1deb369CompareOctober 11, 2021 22:47
@michalursa

Copy link
Copy Markdown
ContributorAuthor

@github-actions crossbow submit -g cpp

@github-actions

Copy link
Copy Markdown

Revision: 1deb369bd9dccd27475ee47574ec14015f35b532

Submitted crossbow builds: ursacomputing/crossbow @ actions-915

TaskStatus
test-conda-cppGithub Actions
test-conda-cpp-valgrindAzure
test-debian-11-cppGithub Actions
test-fedora-33-cppGithub Actions
test-ubuntu-18.04-cppGithub Actions
test-ubuntu-18.04-cpp-releaseGithub Actions
test-ubuntu-18.04-cpp-staticGithub Actions
test-ubuntu-20.04-cppGithub Actions
test-ubuntu-20.04-cpp-14Github Actions
test-ubuntu-20.04-cpp-17Github Actions
test-ubuntu-20.04-cpp-thread-sanitizerGithub Actions

@michalursa
michalursaforce-pushed the ARROW-14211-hash-join-tsan branch from 1deb369 to 3d1ce0cCompareOctober 12, 2021 06:43
@michalursa

Copy link
Copy Markdown
ContributorAuthor

@github-actions crossbow submit -g cpp

@github-actions

Copy link
Copy Markdown

Revision: 3d1ce0c31fdab96ef969d790fc3ac673c8749379

Submitted crossbow builds: ursacomputing/crossbow @ actions-917

TaskStatus
test-conda-cppGithub Actions
test-conda-cpp-valgrindAzure
test-debian-11-cppGithub Actions
test-fedora-33-cppGithub Actions
test-ubuntu-18.04-cppGithub Actions
test-ubuntu-18.04-cpp-releaseGithub Actions
test-ubuntu-18.04-cpp-staticGithub Actions
test-ubuntu-20.04-cppGithub Actions
test-ubuntu-20.04-cpp-14Github Actions
test-ubuntu-20.04-cpp-17Github Actions
test-ubuntu-20.04-cpp-thread-sanitizerGithub Actions

@michalursa
michalursaforce-pushed the ARROW-14211-hash-join-tsan branch 2 times, most recently from 37993cf to c94bd41CompareOctober 12, 2021 22:39
@pitrou

Copy link
Copy Markdown
Member

@michalursa Is this ready for review? Ideally we would like to ship this fix in 6.0.0, which will hopefully be cut in a few days.

@github-actions

Copy link
Copy Markdown

Revision: c94bd41ed08dcbb3dd22585cf97fa536abc48262

Submitted crossbow builds: ursacomputing/crossbow @ actions-952

TaskStatus
test-conda-cppGithub Actions
test-conda-cpp-valgrindAzure
test-debian-11-cppGithub Actions
test-fedora-33-cppGithub Actions
test-ubuntu-18.04-cppGithub Actions
test-ubuntu-18.04-cpp-releaseGithub Actions
test-ubuntu-18.04-cpp-staticGithub Actions
test-ubuntu-20.04-cppGithub Actions
test-ubuntu-20.04-cpp-14Github Actions
test-ubuntu-20.04-cpp-17Github Actions
test-ubuntu-20.04-cpp-thread-sanitizerGithub Actions

@pitrou

Copy link
Copy Markdown
Member

Also, can you rebase from master to ensure that we get the latest CI fixes?

@michalursa
michalursaforce-pushed the ARROW-14211-hash-join-tsan branch from c94bd41 to 9d5bceeCompareOctober 14, 2021 23:11
@michalursa

Copy link
Copy Markdown
ContributorAuthor

@pitrou I rebased. It is ready for review.

@pitrou

Copy link
Copy Markdown
Member

@github-actions crossbow submit -g cpp

@github-actions

Copy link
Copy Markdown

Revision: 9d5bceed669496e863bfde9e59c22d4fcaf3ea25

Submitted crossbow builds: ursacomputing/crossbow @ actions-966

TaskStatus
test-conda-cppGithub Actions
test-conda-cpp-valgrindAzure
test-debian-11-cppGithub Actions
test-fedora-33-cppGithub Actions
test-ubuntu-18.04-cppGithub Actions
test-ubuntu-18.04-cpp-releaseGithub Actions
test-ubuntu-18.04-cpp-staticGithub Actions
test-ubuntu-20.04-cppGithub Actions
test-ubuntu-20.04-cpp-14Github Actions
test-ubuntu-20.04-cpp-17Github Actions
test-ubuntu-20.04-cpp-thread-sanitizerGithub Actions

Comment threadcpp/src/arrow/compute/exec/hash_join.cc Outdated
@pitrou

Copy link
Copy Markdown
Member

@github-actions crossbow submit -g r

@pitrou

Copy link
Copy Markdown
Member

@bkietz Are you available to give a quick review on this? If CI is ok, it would be nice to have this fix in 6.0.0.

@github-actions

Copy link
Copy Markdown

Revision: 9d5bceed669496e863bfde9e59c22d4fcaf3ea25

Submitted crossbow builds: ursacomputing/crossbow @ actions-967

TaskStatus
conda-linux-gcc-py36-cpu-r40Azure
conda-linux-gcc-py37-cpu-r41Azure
conda-osx-clang-py36-r40Azure
conda-osx-clang-py37-r41Azure
conda-win-vs2017-py36-r40Azure
conda-win-vs2017-py37-r41Azure
homebrew-r-autobrewGithub Actions
test-r-arrow-backwards-compatibilityGithub Actions
test-r-depsource-autoAzure
test-r-depsource-systemGithub Actions
test-r-devdocsGithub Actions
test-r-gcc-11Github Actions
test-r-install-localGithub Actions
test-r-linux-as-cranGithub Actions
test-r-linux-rchkGithub Actions
test-r-linux-valgrindAzure
test-r-minimal-buildAzure
test-r-offline-maximalGithub Actions
test-r-offline-minimalAzure
test-r-rhub-debian-gcc-devel-lto-latestAzure
test-r-rhub-ubuntu-gcc-release-latestAzure
test-r-rocker-r-base-latestAzure
test-r-rstudio-r-base-3.6-bionicAzure
test-r-rstudio-r-base-3.6-centos7-devtoolset-8Azure
test-r-rstudio-r-base-3.6-centos8Azure
test-r-rstudio-r-base-3.6-opensuse15Azure
test-r-rstudio-r-base-3.6-opensuse42Azure
test-r-ubuntu-21.04Github Actions
test-r-versionsGithub Actions
test-ubuntu-18.04-r-sanitizerAzure

@bkietzbkietz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one nit, LGTM

Comment threadcpp/src/arrow/compute/exec/hash_join.cc Outdated
@michalursa
michalursaforce-pushed the ARROW-14211-hash-join-tsan branch from 08931a6 to 9fd1c02CompareOctober 18, 2021 19:16
@kou

kou commented Oct 18, 2021

Copy link
Copy Markdown
Member

@github-actions crossbow submit -g cpp -g r

@github-actions

Copy link
Copy Markdown

Revision: 9fd1c024392207bc3622da6a3307c06272efbc4c

Submitted crossbow builds: ursacomputing/crossbow @ actions-994

TaskStatus
conda-linux-gcc-py36-cpu-r40Azure
conda-linux-gcc-py37-cpu-r41Azure
conda-osx-clang-py36-r40Azure
conda-osx-clang-py37-r41Azure
conda-win-vs2017-py36-r40Azure
conda-win-vs2017-py37-r41Azure
homebrew-r-autobrewGithub Actions
test-conda-cppGithub Actions
test-conda-cpp-valgrindAzure
test-debian-11-cppGithub Actions
test-fedora-33-cppGithub Actions
test-r-arrow-backwards-compatibilityGithub Actions
test-r-depsource-autoAzure
test-r-depsource-systemGithub Actions
test-r-devdocsGithub Actions
test-r-gcc-11Github Actions
test-r-install-localGithub Actions
test-r-linux-as-cranGithub Actions
test-r-linux-rchkGithub Actions
test-r-linux-valgrindAzure
test-r-minimal-buildAzure
test-r-offline-maximalGithub Actions
test-r-offline-minimalAzure
test-r-rhub-debian-gcc-devel-lto-latestAzure
test-r-rhub-ubuntu-gcc-release-latestAzure
test-r-rocker-r-base-latestAzure
test-r-rstudio-r-base-3.6-bionicAzure
test-r-rstudio-r-base-3.6-centos7-devtoolset-8Azure
test-r-rstudio-r-base-3.6-centos8Azure
test-r-rstudio-r-base-3.6-opensuse15Azure
test-r-rstudio-r-base-3.6-opensuse42Azure
test-r-ubuntu-21.04Github Actions
test-r-versionsGithub Actions
test-ubuntu-18.04-cppGithub Actions
test-ubuntu-18.04-cpp-releaseGithub Actions
test-ubuntu-18.04-cpp-staticGithub Actions
test-ubuntu-18.04-r-sanitizerAzure
test-ubuntu-20.04-cppGithub Actions
test-ubuntu-20.04-cpp-14Github Actions
test-ubuntu-20.04-cpp-17Github Actions
test-ubuntu-20.04-cpp-thread-sanitizerGithub Actions

@michalursa
michalursaforce-pushed the ARROW-14211-hash-join-tsan branch from 9fd1c02 to 720c4f5CompareOctober 18, 2021 21:39
@kou

kou commented Oct 19, 2021

Copy link
Copy Markdown
Member

@michalursa Can we merge this?

@michalursa

Copy link
Copy Markdown
ContributorAuthor

@michalursa Can we merge this?

@kou Yes, I believe so. This is a relatively simple change (more precisely 3 simple fixes put together) and I don't see any errors that could be related.

@kou

kou commented Oct 19, 2021

Copy link
Copy Markdown
Member

OK.
I merge this.

@koukou closed this in d9ef519Oct 19, 2021
@ursabot

ursabot commented Oct 19, 2021

Copy link
Copy Markdown

Benchmark runs are scheduled for baseline = 6e1293b and contender = d9ef519. d9ef519 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Finished ⬇️0.0% ⬆️0.0%] ec2-t3-xlarge-us-east-2
[Finished ⬇️0.51% ⬆️0.0%] ursa-i9-9960x
[Finished ⬇️0.36% ⬆️0.09%] ursa-thinkcentre-m75q
Supported benchmarks:
ursa-i9-9960x: langs = Python, R, JavaScript
ursa-thinkcentre-m75q: langs = C++, Java
ec2-t3-xlarge-us-east-2: cloud = True

lidavidm pushed a commit that referenced this pull request Oct 19, 2021
#11350 moved ThreadIndexer from `aggregate_node.cc` to `compute/exec/util.h` to allow usage from the join node and incremented its capacity, but did not remove the original implementation.
Closes#11463 from bkietz/remove-duplicated-ThreadIndexer
Authored-by: Benjamin Kietzman <bengilgit@gmail.com>
Signed-off-by: David Li <li.davidm96@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@michalursa@pitrou@kou@ursabot@bkietz