Repository navigation
fix: refuse recovery store writes without the lock and prune idle tombstones - #741
Open
rodrigopavezi wants to merge 1 commit into
Open
rodrigopavezi wants to merge 1 commit into
rodrigopavezi wants to merge 1 commit into
Conversation
…bstones The recovery store now asks the service lock again right before the rename, after the temporary file is written and synced, so a process that no longer holds the store lock leaves recovery.json and its memory as they were. For this store the lock counts as held only while it carries this process's token and its mtime is younger than the stale window minus one heartbeat (20 s), since a holder whose heartbeat fell behind may be in the middle of a takeover. heal() also runs the 30-day tombstone removal when memory holds an expired tombstone, so the removal holds on a store that gets no writes. Part of #444
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
O que muda e por quê
Dois ajustes no
recovery.json(passkeys extras e código de recuperação), depois do #735:heal(), que já roda a cada 10 s, agora descarta as que passaram de 30 dias e grava o arquivo.Sem mudança de formato nem de rota. O texto dos Termos e da Política não muda: a Política já fala em 30 dias.
Issue
Parte da #444.
Como verificar
node apps/cli/test/recovery-store.test.jsnode apps/cli/test/account.test.jsnode apps/cli/test/account-recovery.test.jsnode packages/core/test/store.test.jsdocs/verification/fix-recovery-store-lock-fence.md.Na rodada local de
npm test -- --affected=origin/main(855 arquivos), dois arquivos estouraram o tempo, nenhum deles ligado ao que mudou:apps/cli/test/update.test.jspassou sozinho (73/73 testes, 1901/1901 asserções); empackages/core/test/private-member-3.test.js, "fake bans from an unadmitted writer never inflate a rotation" passou dos 30 s, também sozinho e também numa árvore damainsem esta mudança (a CI damainem 0f7cadc passou).Checklist
npm run lintenpm run demopassam;npm test -- --affected=origin/mainpassa, salvo dois estouros de tempo descritos acimarecovery.json)docs/changelog/fix-recovery-store-lock-fence.mde verificação emdocs/verification/fix-recovery-store-lock-fence.md, sem editar o CHANGELOG.md nem acrescentar seção ao docs/verification.md