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

chore: compact status tables before proceeding with migration #2688

Merged
merged 5 commits into from
Nov 25, 2022

Conversation

Sidddddarth
Copy link
Member

@Sidddddarth Sidddddarth commented Nov 10, 2022

Description

Cleaning up the status table(delete all but the latest status per job) before proceeding with migration.
The DSs this is done to, are selected via analyzer estimates(pg_class.reltuples) and based on existing thresholds.
This is once again repeated before the tables are backup, just to ensure that there's only one status per job in the uploaded file.
Moved migration related logic to jobsdb/migration.go.

Notion Ticket

Perform compaction on the rightmost dataset during migration if necessary

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

@Sidddddarth Sidddddarth requested a review from atzoum November 10, 2022 10:18
@Sidddddarth Sidddddarth changed the title clean up status table before proceeding with migration chore: clean up status table before proceeding with migration Nov 10, 2022
@Sidddddarth Sidddddarth force-pushed the chore.statusCleanUpDuringMigrationLoop branch 2 times, most recently from 95cdfcd to a48c1ab Compare November 10, 2022 12:56
@Sidddddarth Sidddddarth force-pushed the chore.statusCleanUpDuringMigrationLoop branch from a48c1ab to 8ca7b37 Compare November 11, 2022 07:42
@codecov
Copy link

codecov bot commented Nov 11, 2022

Codecov Report

Base: 46.63% // Head: 46.84% // Increases project coverage by +0.20% 🎉

Coverage data is based on head (2160cf7) compared to base (88f1ec1).
Patch coverage: 78.09% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2688      +/-   ##
==========================================
+ Coverage   46.63%   46.84%   +0.20%     
==========================================
  Files         297      298       +1     
  Lines       48696    48749      +53     
==========================================
+ Hits        22711    22836     +125     
+ Misses      24557    24482      -75     
- Partials     1428     1431       +3     
Impacted Files Coverage Δ
jobsdb/jobsdb.go 72.96% <ø> (-0.01%) ⬇️
jobsdb/backup.go 75.81% <40.00%> (-0.50%) ⬇️
jobsdb/migration.go 78.59% <78.59%> (ø)
router/router.go 73.86% <0.00%> (+0.18%) ⬆️
jobsdb/setup.go 90.69% <0.00%> (+0.22%) ⬆️
config/backend-config/namespace_config.go 70.00% <0.00%> (+3.00%) ⬆️
router/manager/manager.go 100.00% <0.00%> (+3.29%) ⬆️
processor/stash/stash.go 66.66% <0.00%> (+22.09%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@atzoum atzoum force-pushed the chore.statusCleanUpDuringMigrationLoop branch from 8ca7b37 to 446523b Compare November 14, 2022 06:45
@Sidddddarth Sidddddarth force-pushed the chore.statusCleanUpDuringMigrationLoop branch 6 times, most recently from 43822d6 to a9c24c3 Compare November 17, 2022 13:24
@Sidddddarth Sidddddarth force-pushed the chore.statusCleanUpDuringMigrationLoop branch 2 times, most recently from 0d89d50 to 2647a06 Compare November 22, 2022 13:35
@atzoum atzoum force-pushed the chore.statusCleanUpDuringMigrationLoop branch from 8892629 to 51a6134 Compare November 23, 2022 08:22
@Sidddddarth Sidddddarth force-pushed the chore.statusCleanUpDuringMigrationLoop branch from 51a6134 to ce3066c Compare November 24, 2022 04:13
@Sidddddarth Sidddddarth marked this pull request as ready for review November 24, 2022 04:16
@atzoum atzoum changed the title chore: clean up status table before proceeding with migration chore: compact status tables before proceeding with migration Nov 24, 2022
@atzoum atzoum force-pushed the chore.statusCleanUpDuringMigrationLoop branch from ce3066c to ed67cd2 Compare November 24, 2022 08:48
@Sidddddarth Sidddddarth force-pushed the chore.statusCleanUpDuringMigrationLoop branch from e4e0623 to 2160cf7 Compare November 25, 2022 10:54
Copy link
Member

@chandumlg chandumlg left a comment

Choose a reason for hiding this comment

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

A comment posted. Please take a look.

jobsdb/migration.go Show resolved Hide resolved
@chandumlg chandumlg merged commit 27299f2 into master Nov 25, 2022
@chandumlg chandumlg deleted the chore.statusCleanUpDuringMigrationLoop branch November 25, 2022 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants