yugabyte / yugabyte-db

YugabyteDB - the cloud native distributed SQL database for mission-critical applications.
https://www.yugabyte.com
Other
9k stars 1.07k forks source link

ybase: add regularVsNonRegular or similar #9534

Open jaki opened 3 years ago

jaki commented 3 years ago

Jira Link: DB-2165 We have macros and functions that switch between two given values depending on whether the build type is sanitizer or nonsanitizer. This is mostly used for timing in tests because sanitizer builds tend to take longer.

Commit 80b8598cf31ed9eb764c2d2664c328a91106b859, titled "[#6643] Disable optimizations for debug build", changes the debug build type so that it disables compiler optimizations, going from -O1 to nothing. It is noticeable how much slower operations are with that change. I estimate that timing at least doubled. SELECTs to an empty table take ~10ms instead of ~5ms; CREATE INDEX (concurrently) takes ~10s instead of ~3s.

This affects the amount of time tests take, so existing tests can more easily hit timeout. One of my in-progress Java tests TestPgRegressGin hits 500s timeout consistently (on debug build) after rebasing over this commit. After bumping up the timeout, it appears that the test takes 712.844s. This is very similar to ASAN, which takes 891.754s.

The point is that debug probably belongs in the sanitizers category of timing. release and fastdebug take about half as long as debug, asan, and tsan. Therefore, new switch functions should be created for this arrangement (or the existing ones should update the arrangement (and probably rename themselves accordingly)).

keywords: SanitizerUtil.nonSanitizerVsSanitizer, SanitizerUtil, nonSanitizerVsSanitizer, RegularBuildVsSanitizers, IsSanitizer, NonTsanVsTsan

jaki commented 3 years ago

org.yb.cql.TestYbBackup Java tests keep failing by timeout on our Jenkins runs. They always fail on the centos debug builds. They also failed on the centos debug runs for D10121 (the disable debug optimizations revision).

jaki commented 3 years ago

I hit the 1800s timeout on TestPgRegressTypesUDT java test on centos-gcc-debug. According to logs, it reached yb_pg_rangetypes test, the second-to-last test.

ttyusupov commented 3 years ago

Note that originally we had optimizations disabled for debug build type, but it was enabled during the quick fix of #1291 (while the proper fix was #4789 / 4142c34e69306fe2e59cf4ae188fd03a71ed0862).

ttyusupov commented 3 years ago

Based on comparison of 2.6 debug build vs latest master debug build test runs, the most overhead without optimisation under debug build is from the following tests: org.yb.multiapi. org.yb.pgsql. PgIndexBackfillTest PgLibPqTest TwoDCTestParams/TwoDCTest TwoDCTestParams/TwoDCYsqlTest PgMiniTest