gecko-dev/services/sync
Marco Bonardo e9ffac0820 Bug 1846781 - Use recalc_frecency for updating origins frecency instead of triggers. r=daisuke
Until now we updated origins frecency using direct SQL triggers.
While that guaranteed good performance, it also had some downsides:
 * replacing the algorithms is complicate, the current system only works
   with a straight sum of page frecencies. We are planning to experiment with
   different algorithms in the future.
 * it requires using multiple temp tables and DELETE triggers, that is error
   prone for consumers, that may forget to DELETE from the temp tables, and thus
   break data coherency.
 * there's not much atomicity, since the origins update must be triggered apart
   and a crash would lose some of the changes

This patch is changing the behavior to be closer to the recalc_frecency one that
is already used for pages.
When a page is added, visited, or removed, recalc_frecency of its origin is set
to 1. Later frecency of invalidated origins will be recalculated in chunks.
While this is surely less efficient than the existing system, it solves the
problems presented above.
A threshold is recalculated at each chunk, and stored in the moz_meta table.
This patch continues using the old STATS in the moz_meta table, to allow for
easier downgrades. Once a new threshold will be introduced we'll be able to
stop updating those.

The after delete temp table is maintained because there's no more efficient way
to remove orphan origins promptly. Thus, after a removal from moz_places,
consumers MUST still DELETE from the temp table to cleanup orphan origins.
This also introduces a delayed removal of orphan origins when their frecency
becomes 0.

Differential Revision: https://phabricator.services.mozilla.com/D186070
2023-09-13 13:58:30 +00:00
..
docs Bug 1831630 - add sync payload evolution docs. r=sgalich 2023-05-05 19:56:06 +00:00
golden_gate Bug 1617369 - Reformat recent rust changes with rustfmt r=emilio 2023-04-03 11:52:23 +00:00
modules Update configs. IGNORE BROKEN CHANGESETS CLOSED TREE NO BUG a=release ba=release 2023-08-28 14:03:43 +00:00
modules-testing Bug 1845252 - Update consumers of FxAccountsCommon to import the ES module directly. r=markh,settings-reviewers,credential-management-reviewers,sync-reviewers,sgalich,Gijs 2023-07-31 13:05:44 +00:00
tests Bug 1846781 - Use recalc_frecency for updating origins frecency instead of triggers. r=daisuke 2023-09-13 13:58:30 +00:00
tps/extensions/tps Bug 1846036, replace usage of findLogins with searchLoginsAsync, r=credential-management-reviewers,sync-reviewers,joschmidt,markh 2023-08-15 00:21:05 +00:00
SyncComponents.manifest
Weave.sys.mjs Bug 1844784 - Ensure Synced Tabs in the history menu is properly removed when FxAccounts are disabled. r=sync-reviewers,places-reviewers,lina,markh 2023-08-09 15:00:20 +00:00
components.conf
moz.build Bug 1831872 - Migrate client.name2 string from sync.properties to Fluent. r=markh,fluent-reviewers,geckoview-reviewers,sync-reviewers,flod,m_kato 2023-05-29 15:24:38 +00:00