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

perf: don't extract backups whenever possible #25350

Merged
merged 39 commits into from
Mar 13, 2024

Conversation

akhilnarang
Copy link
Member

@akhilnarang akhilnarang commented Mar 12, 2024

Also includes a few more backports from develop branch to minimize conflicts

  • Restore old backup onto this branch
  • Restore new backup onto this branch
  • Restore v14 backup
  • Restore v16 backup - get prompted y/n to switch versions
  • Test partial backup with normal and partial restores

@akhilnarang akhilnarang requested a review from a team as a code owner March 12, 2024 06:40
@akhilnarang akhilnarang requested review from ankush and removed request for a team March 12, 2024 06:40
akhilnarang and others added 27 commits March 13, 2024 11:55
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
[skip_ci]

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
(cherry picked from commit 40a2daf)
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
(cherry picked from commit 5b33608)
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
(cherry picked from commit 9228cd7)
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Co-authored-by: Akhil Narang <me@akhilnarang.dev>
(cherry picked from commit 283e91f)
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Read from the gzipped file wherever possible

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
…eleted

This allows us to not have to call it everytime before returning

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Use `zgrep` to check for table name match where required

Also use a table that's at the top of the dump files (`__Auth`)

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Use `gzip -cd` to directly get the contents onto stdout and pipe to mariadb

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Determine the mimetype based on the file contents instead of waiting for an exception
Cleaner + no need of duplicate code

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
… an archive

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
First actually check whether its a downgrade, then check for the force flag

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Our version detection code is relatively simple, so we shouldn't have any exceptions arising there
Just check for a None return value to decide whether we should use the older logic

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Also fix the actual comparison

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
No point if we're using `execute_in_shell()`

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
…ommands

Drop the complicated logic behind storing pid and killing process if first stage of pipe fails

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
akhilnarang and others added 11 commits March 13, 2024 11:57
`pipefail` isn't supported in sh, bash is common enough to be installed nearly everywhere

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Encrypted backup/restores just fail without a clear error message if gpg is missing

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
(cherry picked from commit 235be44)
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Without this, the cleanup code won't run after if `sys.exit()` is called when we yield

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
`-- Backup generated by Frappe 15.1.0 on branch fix-backup-restore`

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
(cherry picked from commit b992357)
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Seemed a bit confusing, frappe#24898 (comment)

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
@akhilnarang akhilnarang merged commit 9c6fb8a into frappe:version-15-hotfix Mar 13, 2024
17 of 18 checks passed
@akhilnarang akhilnarang deleted the backport-22915 branch March 13, 2024 11:00
frappe-pr-bot pushed a commit that referenced this pull request Mar 19, 2024
# [15.18.0](v15.17.3...v15.18.0) (2024-03-19)

### Bug Fixes

* add params in make_request arguments ([#25418](#25418)) ([18cf09b](18cf09b))
* allow transitioning to long text (backport [#25419](#25419)) ([#25475](#25475)) ([dbb326e](dbb326e))
* avoid closing filter popover on any date picker interactions ([cd98a21](cd98a21))
* Avoid setting filter on now/today button ([592e6f9](592e6f9))
* better filename for prepared report ([8eb1b24](8eb1b24))
* child table rating fields ([#25433](#25433)) ([#25436](#25436)) ([6f242ca](6f242ca))
* consider all datepicker elements ([#25426](#25426)) ([361fbfe](361fbfe))
* **ControlText:** Preserve indentation when read only ([#25262](#25262)) ([#25469](#25469)) ([c783f22](c783f22))
* debounce filter refresh ([9b75187](9b75187))
* default filter setup on todo list ([#25455](#25455)) ([#25464](#25464)) ([21e1280](21e1280))
* dont add trailing decimal separator ([#25389](#25389)) ([#25391](#25391)) ([760d9b2](760d9b2))
* dont add useless distinct clause ([8891e8e](8891e8e))
* dont render very large reports, offer export instead ([3f0760c](3f0760c))
* dont show tooltip if already limited ([#25361](#25361)) ([eb8b9f4](eb8b9f4))
* escape text types before setting disp area ([#25520](#25520)) ([#25523](#25523)) ([bc83b24](bc83b24))
* escape value in multiselect pill ([#25516](#25516)) ([#25518](#25518)) ([236a3b5](236a3b5))
* exclude irrelevant regional links ([#25510](#25510)) ([#25512](#25512)) ([9fe8b6a](9fe8b6a))
* filters can use more than 140 chars ([2d2b4a9](2d2b4a9))
* handle distinct for fieldname ([#25511](#25511)) ([#25515](#25515)) ([9168b0f](9168b0f))
* handle invalid fetch from split ([fa131ca](fa131ca))
* handle meta.fields being undefined ([#25539](#25539)) ([01cca38](01cca38))
* handle parent rename in child workspace ([ef3d068](ef3d068))
* hide datepicker after picking date ([d91a2b8](d91a2b8))
* **json_handler:** handle `uuid.UUID` ([ebaaa6b](ebaaa6b)), closes [#25242](#25242)
* Log ipython commands (backport [#25364](#25364)) ([#25368](#25368)) ([a2ebb4e](a2ebb4e))
* log mariadb console usage ([9797457](9797457))
* log psql console usage as well (backport [#25417](#25417)) ([#25423](#25423)) ([f0fa5d1](f0fa5d1))
* prevent TypeError if doc not defined ([#25540](#25540)) ([6b23504](6b23504))
* **QuickEntry:** Don't allow Tab Breaks ([#24950](#24950)) ([#25468](#25468)) ([a31943e](a31943e))
* **recorder:** handle frappe.db.sql(run=0) ([#25450](#25450)) ([#25454](#25454)) ([d130777](d130777))
* Respect document language in communication ([#25402](#25402)) ([#25403](#25403)) ([0d09b51](0d09b51))
* show attachments on notifications too ([#25443](#25443)) ([#25445](#25445)) ([371fa09](371fa09))
* skip setting of contact full name if its too long ([#25509](#25509)) ([d5685d7](d5685d7))
* skip virtual doctype in tags ([f18ac26](f18ac26))
* Skip virtual doctype rename for dynamic links ([#25479](#25479)) ([#25481](#25481)) ([3353488](3353488))
* Skip virtual doctypes while renaming ([#25473](#25473)) ([#25478](#25478)) ([aaacc51](aaacc51))
* support child tables in count with limit ([d8a797b](d8a797b))
* traceback colours ([#25356](#25356)) ([b6d2785](b6d2785))
* **UX:** let user see actual count on click ([5c1bca8](5c1bca8))
* validate homepage paths (backport [#25409](#25409)) ([#25412](#25412)) ([0aeaeeb](0aeaeeb))
* we want `DF.Literal[None]`, not `DF.LiteralNone` ([#25394](#25394)) ([f008eeb](f008eeb))

### Features

* connect to redis sentinel for redis cache ([#25398](#25398)) ([#25446](#25446)) ([498b1a4](498b1a4))
* debug stuck process by sending SIGUSR1 (backport [#25502](#25502)) ([#25527](#25527)) ([6c8cc5c](6c8cc5c))
* move bulk print operation to the background (backport [#25358](#25358)) ([#25397](#25397)) ([513487e](513487e))
* Store printed PDF attachments on communication ([#25439](#25439)) ([#25444](#25444)) ([bd15abc](bd15abc))
* support countig till a limit ([615800f](615800f))

### Performance Improvements

* Avoid ordering in count query ([#25451](#25451)) ([#25452](#25452)) ([07aadd3](07aadd3))
* compact prepared report files ([3adbb35](3adbb35))
* don't extract backups whenever possible ([#25350](#25350)) ([9c6fb8a](9c6fb8a)), closes [/github.com//pull/24898#discussion_r1521076386](https://github.com//github.com/frappe/frappe/pull/24898/issues/discussion_r1521076386)
* reduce import overhead on background jobs (backport [#25459](#25459)) ([#25460](#25460)) ([eab5b8d](eab5b8d))
* show estimated count on list view ([7ee9719](7ee9719))
@frappe-pr-bot
Copy link
Collaborator

🎉 This PR is included in version 15.18.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@mohsinalimat
Copy link

mohsinalimat commented Mar 26, 2024

@akhilnarang Please check this.
#25648

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants