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

Add TPC-DS stress tests #17

Merged
merged 24 commits into from
Jan 10, 2020
Merged

Add TPC-DS stress tests #17

merged 24 commits into from
Jan 10, 2020

Conversation

ololobus
Copy link
Contributor

@ololobus ololobus commented Oct 26, 2019

I have tried to focus here only on adding TPC-DS tests. Sergey's solution from #16 was reworked. The key point was to add TPC-DS without affecting all previous test cases.

The following new features added:

  • Run pg_query_state under TPC-DS load
  • Refactor everything to support both Python 2/3, since Python 2 ends its life cycle on January 1 2020

@codecov-io
Copy link

codecov-io commented Oct 26, 2019

Codecov Report

Merging #17 into master will increase coverage by 11.77%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           master      #17       +/-   ##
===========================================
+ Coverage   77.09%   88.86%   +11.77%     
===========================================
  Files           4        2        -2     
  Lines         502      503        +1     
===========================================
+ Hits          387      447       +60     
+ Misses        115       56       -59
Impacted Files Coverage Δ
pg_bin/include/postgresql/server/utils/palloc.h
pg_bin/include/postgresql/server/storage/s_lock.h
signal_handler.c 97.59% <0%> (+6.12%) ⬆️
pg_query_state.c 87.14% <0%> (+13.22%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0ebe691...8545705. Read the comment docs.

@ololobus ololobus requested a review from maksm90 October 30, 2019 11:10
Comment on lines +81 to +83
MAX_FIRST_GETTING_QS_RETRIES = 10
PG_QS_DELAY, BEFORE_GETTING_QS_DELAY = 0.1, 0.1
BEFORE_GETTING_QS, GETTING_QS = range(2)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These look like constants, so I would prefer to move them to the place near TPC_DS_EXCLUDE_LIST

Copy link
Collaborator

Choose a reason for hiding this comment

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

Accepted

Comment on lines +124 to +125
parser.add_argument('--tpc-ds-setup', dest='tpcds_setup', action='store_true', help='setup database to run TPC-DS benchmark')
parser.add_argument('--tpc-ds-run', dest='tpcds_run', action='store_true', help='run only stress test based on TPC-DS benchmark')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why do you separate TPC-DS run and setup? You cannot run tests without a setup I guess. And what is the point to setup without run?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Because the whole task(TPC-DS running) is huge and its running takes much time. Clearly, it have to be decomposed to separate subtasks so to be able to run their more granular. This separation is the fist step to achieve it. In particular, it provides to run tpc-ds bench multiple times for debugging purpose without initializing database at all time.
Yes, tpc-ds-run requires tpc-ds-setup and fails until database is initialized properly.

tests/common.py Outdated
@@ -0,0 +1,103 @@
'''
common.py
Copyright (c) 2016-2019, Postgres Professional
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess you can put 2020 everywhere already :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Done

tests/tpcds.py Outdated
Comment on lines 6 to 11
import common
import os
import progressbar
import psycopg2.extensions
import subprocess
import time
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would prefer following order (built-in library first, extra modules second, local modules last):

import os
import time
import subprocess

import psycopg2.extensions
import progressbar

import .common

Just for cleanliness

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thx, accepted

@maksm90 maksm90 merged commit 79fc013 into postgrespro:master Jan 10, 2020
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

Successfully merging this pull request may close these issues.

3 participants