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(backend): Defer instance metadata update #14558

Merged
merged 11 commits into from
Sep 26, 2024

Conversation

KOBA789
Copy link
Contributor

@KOBA789 KOBA789 commented Sep 16, 2024

What

#11093 の対応を、Redis などを使わずにお手軽に in-process でやるパッチです。

Why

inbox に同一ホストからの note がたくさん入ってくると UPDATE instance が行ロックを取り合って渋滞するので、更新をメモリ上で潰して数を減らすことでそれを解決します。

Additional info (optional)

@syuilo 1案として書いてみたので参考にしてください。

Checklist

  • たまにテストがコケるのを直す
  • Read the contribution guide
  • Test working in a local environment
  • (If needed) Add story of storybook
  • (If needed) Update CHANGELOG.md
  • (If possible) Add tests

@github-actions github-actions bot added the packages/backend Server side specific issue/PR label Sep 16, 2024
Copy link
Contributor

github-actions bot commented Sep 16, 2024

このPRによるapi.jsonの差分
差分はありません。
Get diff files from Workflow Page

Copy link

codecov bot commented Sep 16, 2024

Codecov Report

Attention: Patch coverage is 75.67568% with 27 lines in your changes missing coverage. Please review.

Project coverage is 39.57%. Comparing base (4c76ea1) to head (3114897).
Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
...kend/src/queue/processors/InboxProcessorService.ts 59.57% 19 Missing ⚠️
packages/backend/src/misc/collapsed-queue.ts 88.63% 5 Missing ⚠️
packages/backend/src/core/NoteCreateService.ts 85.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #14558      +/-   ##
===========================================
+ Coverage    39.53%   39.57%   +0.03%     
===========================================
  Files         1543     1544       +1     
  Lines       193142   193240      +98     
  Branches      3489     2489    -1000     
===========================================
+ Hits         76364    76467     +103     
+ Misses      116213   116208       -5     
  Partials       565      565              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@KOBA789
Copy link
Contributor Author

KOBA789 commented Sep 16, 2024

あ〜〜 5分後に UPDATE 発行されることになってるからテスト用テーブルが解体されたあとにクエリが飛んでテストがエラーになっとる……

@kakkokari-gtyih
Copy link
Contributor

MisskeyIO#735 もこっちに入れたほうが良かったりします?

@kakkokari-gtyih kakkokari-gtyih modified the milestone: v2024.9.0 Sep 19, 2024
@syuilo
Copy link
Member

syuilo commented Sep 24, 2024

引き継ぎます

@KOBA789
Copy link
Contributor Author

KOBA789 commented Sep 24, 2024

@syuilo 動けてなくて申し訳ないです。よろしくお願いします。
PR そのまま引き継ぐでも差分持って行って別途やるでも大丈夫です(コミットの author が私でなくなっても大丈夫という意味)。

@kakkokari-gtyih

This comment was marked as off-topic.

@syuilo

This comment was marked as off-topic.

@syuilo syuilo added this to the v2024.9.0 milestone Sep 24, 2024
@syuilo syuilo marked this pull request as ready for review September 26, 2024 01:25
@syuilo syuilo merged commit 7134d24 into misskey-dev:develop Sep 26, 2024
32 checks passed
@syuilo
Copy link
Member

syuilo commented Sep 26, 2024

🙏🏻

HotoRas pushed a commit to HotoRas/misskey-neko that referenced this pull request Sep 27, 2024
* Defer instance metadata update

* Fix last new line

* Fix typo

* Add license notice

* Fix syntax

* Perform deferred jobs on shutdown

* Fix missing async/await

* Fix typo :)

* Update collapsed-queue.ts

---------

Co-authored-by: syuilo <[email protected]>
syuilo pushed a commit that referenced this pull request Oct 5, 2024
* fix(backend/test): MisskeyIO#727 以降e2eテストがたまに失敗する問題を修正 (MisskeyIO#735)

* ✌️

---------

Co-authored-by: まっちゃとーにゅ <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages/backend Server side specific issue/PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants