Quality Assurance in PostgreSQL Anastasia Lubennikova Aleksander - - PowerPoint PPT Presentation

quality assurance in postgresql
SMART_READER_LITE
LIVE PREVIEW

Quality Assurance in PostgreSQL Anastasia Lubennikova Aleksander - - PowerPoint PPT Presentation

Quality Assurance in PostgreSQL Anastasia Lubennikova Aleksander Alekseev Agenda Development Testing Benchmarking Tools Other Topics What is PostgreSQL? Open source object-relational database system


slide-1
SLIDE 1

Quality Assurance in PostgreSQL

Anastasia Lubennikova Aleksander Alekseev

slide-2
SLIDE 2

Agenda

  • Development
  • Testing
  • Benchmarking
  • Tools
  • Other Topics
slide-3
SLIDE 3

What is PostgreSQL?

  • Open source object-relational database system
  • Over 20 years of development
  • Hundreds of developers around the world
  • Several major vendors
slide-4
SLIDE 4
slide-5
SLIDE 5

What’s so Special About PostgreSQL?

  • Pure C
  • Complicated project
  • Mission critical
  • Cross-platform (Windows, Linux, MacOS, Solaris, *BSD, AIX, HP-UX, ...)
  • High code quality
  • Great documentation
  • Major releases every year
slide-6
SLIDE 6

Development Process

  • Git, C, Autotools, Perl
  • Mailing Lists

○ pgsql-hackers@ ○ pgsql-committers@ ○ pgsql-bugs@ ○ etc

  • Conferences

○ pgcon.org ○ pgconf.us ○ pgconf.ru ○ … and many more!

slide-7
SLIDE 7

Yes, Mailing Lists

slide-8
SLIDE 8
slide-9
SLIDE 9
slide-10
SLIDE 10
slide-11
SLIDE 11

Submitting a Patch

  • Optional: Proposal and discussion
  • Optional: PoC
  • Patch is added to commitfest
  • While(not ready):

○ Code review ○ Testing ○ Discussion ○ More discussion ○ Rewrite a patch

  • Either:

○ Patch is accepted ○ Patch is moved to the next commitfest ○ Patch is returned with a feedback

slide-12
SLIDE 12
slide-13
SLIDE 13

What to test?

  • Modular* tests

○ Indexes ○ Replication ○ Types ○ WAL / Recovery

  • Integration/system tests

○ How various features work together? ○ Upgrade, Backup/Restore, etc

  • Performance

○ Previous versions ○ Other implementations

  • Documentation (SGML)
  • Alpha and beta tests
slide-14
SLIDE 14

How to test?

  • Code review
  • Regular SQL input / output tests

○ Can’t test utilities, concurrency, etc.. ○ Must be deterministic

Should be executed to see the exact output

  • TAP/Perl tests

○ SSL ○ Replication and recovery

  • pgTAP framework
  • Testgres - python framework
slide-15
SLIDE 15

Benchmarks

  • Industry standard benchmarks

○ TPC-H ○ TPC-E ○ TPC-B

  • Pgbench
slide-16
SLIDE 16

Basic Tools

  • gcc / clang / ...
  • gdb / lldb
  • vim + :set spell spelllang=en_us,ru_ru
  • Asserts
  • wal_consistency_checking = 'all'
  • log_level = DEBUG
  • amcheck (property based tests)
  • sqlsmith (fuzzing)
  • valgrind
slide-17
SLIDE 17

Perf: perf top

slide-18
SLIDE 18

Perf: flamegraphs

slide-19
SLIDE 19

HeapTrack + Massif Visualizer

slide-20
SLIDE 20

lcov [ 1 / 2]

slide-21
SLIDE 21

lcov [ 2 / 2 ]

slide-22
SLIDE 22

Clang Static Analyzer

slide-23
SLIDE 23

Books

slide-24
SLIDE 24

Links

  • https://www.postgresql.org/
  • http://postgres-edu.blogspot.ru/search/label/Hacking%20PostgreSQL
  • https://github.com/afiskon/pgscripts
  • https://habr.ru/p/308442/ + related articles
slide-25
SLIDE 25

Thank you for your attention!

  • https://postgrespro.com/ (We are hiring! ;)
  • a.lubennikova@postgrespro.ru
  • a.alekseev@postgrespro.ru