Skip to content

Postgres: Properly initialize database on startup and debugger #7255

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

Merged
merged 6 commits into from
Mar 10, 2021

Conversation

dplewis
Copy link
Member

@dplewis dplewis commented Mar 9, 2021

New Pull Request Checklist

Issue Description

Closes: #7021

  • Ensures schema exists on start up.
  • Ensures initialization is performed first by removing parallel operation.
  • Fixes any relation "_SCHEMA" does not exist flaky tests
  • Fixed any schema does not validate messages
  • Reduces the number of CREATE TABLE IF NOT EXISTS "_SCHEMA" calls
  • Improves testing speeds since test cleanup is moved to afterEach only.
  • Improves tests that delete database but doesn't initialize.
  • Add pg-monitor for improved debugging.

TODOs before merging

  • Add test cases
  • Add entry to changelog
  • Add changes to documentation (guides, repository pages, in-code descriptions)
  • Add security check
  • Add new Parse Error codes to Parse JS SDK
  • ...

@codecov
Copy link

codecov bot commented Mar 9, 2021

Codecov Report

Merging #7255 (eca7a0d) into master (de50b7b) will decrease coverage by 0.02%.
The diff coverage is 86.36%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7255      +/-   ##
==========================================
- Coverage   94.03%   94.00%   -0.03%     
==========================================
  Files         172      172              
  Lines       12970    12959      -11     
==========================================
- Hits        12196    12182      -14     
- Misses        774      777       +3     
Impacted Files Coverage Δ
src/Adapters/Storage/Postgres/PostgresClient.js 77.77% <33.33%> (-8.89%) ⬇️
...dapters/Storage/Postgres/PostgresStorageAdapter.js 95.58% <93.75%> (-0.28%) ⬇️
src/Controllers/DatabaseController.js 95.46% <100.00%> (ø)
src/ParseServer.js 89.53% <100.00%> (-0.07%) ⬇️
src/RestWrite.js 94.00% <0.00%> (+0.16%) ⬆️
src/ParseServerRESTController.js 98.50% <0.00%> (+1.49%) ⬆️

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 de50b7b...a53d816. Read the comment docs.

Copy link
Contributor

@vitaly-t vitaly-t left a comment

Choose a reason for hiding this comment

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

At least as far as pg-monitor goes, it looks fine :)

@dplewis
Copy link
Member Author

dplewis commented Mar 10, 2021

I wish I would have discovered it years ago, it’s really helpful debugging transactions

@davimacedo
Copy link
Member

@dplewis dplewis changed the title Postgres: Properly initialize database on startup Postgres: Properly initialize database on startup and debugger Mar 10, 2021
@dplewis
Copy link
Member Author

dplewis commented Mar 10, 2021

@davimacedo How does this look?

Copy link
Member

@davimacedo davimacedo left a comment

Choose a reason for hiding this comment

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

LGTM!

@davimacedo davimacedo merged commit 39fa17f into master Mar 10, 2021
@davimacedo davimacedo deleted the pg-init branch March 10, 2021 19:31
Arul- pushed a commit to Arul-/parse-server that referenced this pull request Mar 25, 2021
…-community#7255)

* PG: Properly initialize database

* fix flaky tests

* flaky test

* correct test

* no idea

* clean up debugger
@GEverding

This comment has been minimized.

@mtrezza

This comment has been minimized.

@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.0.0-beta.1

@parseplatformorg parseplatformorg added the state:released-beta Released as beta version label Nov 1, 2021
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.0.0

@parseplatformorg parseplatformorg added the state:released Released as stable version label Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:released Released as stable version state:released-beta Released as beta version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

There are a lot of logs as CREATE TABLE IF NOT EXISTS "_SCHEMA"
6 participants