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

Call walproposer from Rust #5403

Merged
merged 9 commits into from
Oct 19, 2023
Merged

Call walproposer from Rust #5403

merged 9 commits into from
Oct 19, 2023

Conversation

petuhovskiy
Copy link
Member

@petuhovskiy petuhovskiy commented Sep 27, 2023

Create Rust bindings for C functions from walproposer. This allows to write better tests with real walproposer code without spawning multiple processes and starting up the whole environment.

make walproposer-lib stage was added to build static libraries libwalproposer.a, libpgport.a, libpgcommon.a. These libraries can be statically linked to any executable to call walproposer functions.

libs/walproposer/src/walproposer.rs contains test_simple_sync_safekeepers to test that walproposer can be called from Rust to emulate sync_safekeepers logic. It can also be used as a usage example.

Cargo.lock Outdated Show resolved Hide resolved
Cargo.lock Outdated Show resolved Hide resolved
Cargo.lock Outdated Show resolved Hide resolved
@github-actions
Copy link

github-actions bot commented Sep 27, 2023

2322 tests run: 2207 passed, 0 failed, 115 skipped (full report)


Flaky tests (1)

Postgres 15

Code coverage (full report)

  • functions: 53.0% (8397 of 15846 functions)
  • lines: 80.5% (49041 of 60884 lines)

The comment gets automatically updated with the latest test results
d3f9621 at 2023-10-19T11:55:09.780Z :recycle:

@petuhovskiy petuhovskiy force-pushed the rust-walproposer branch 8 times, most recently from c7a5967 to 3a14bf0 Compare September 28, 2023 10:23
Base automatically changed from walproposer-struct to main October 5, 2023 17:48
@petuhovskiy petuhovskiy force-pushed the rust-walproposer branch 3 times, most recently from 13abd92 to 03ef121 Compare October 6, 2023 13:18
@petuhovskiy petuhovskiy force-pushed the rust-walproposer branch 3 times, most recently from b461745 to eadc86f Compare October 11, 2023 15:42
@petuhovskiy petuhovskiy marked this pull request as ready for review October 11, 2023 15:49
@petuhovskiy petuhovskiy requested a review from a team as a code owner October 11, 2023 15:49
@petuhovskiy petuhovskiy requested review from knizhnik and arssher and removed request for a team October 11, 2023 15:49
Copy link
Contributor

@arssher arssher left a comment

Choose a reason for hiding this comment

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

Impressive work!

pgxn/neon/walproposer.h Show resolved Hide resolved
pgxn/neon/walproposer.h Show resolved Hide resolved
libs/walproposer/build.rs Show resolved Hide resolved
libs/walproposer/src/walproposer.rs Show resolved Hide resolved
@petuhovskiy petuhovskiy merged commit 66f8f5f into main Oct 19, 2023
41 checks passed
@petuhovskiy petuhovskiy deleted the rust-walproposer branch October 19, 2023 13:17
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.

None yet

2 participants