deliver Delete activities to all known instances #198
Labels
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Reference: FoundKeyGang/FoundKey#198
Loading…
Reference in a new issue
No description provided.
Delete branch "deliver-delete-everyone"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ -88,0 +101,4 @@
if (this.recipes.some(r => isEveryone(r))) {
// deliver to all of known network
const sharedInboxes = await Users.createQueryBuilder('users')
SELECT DISTINCT
would be preferable. Overall, it seems that target inboxes are not deduplicated.That is what the
groupBy
in line 111 was meant for. I didn't know, but just checked and there is.distinct(true)
available for query builders to achieveSELECT DISTINCT
. I'm not sure if it makes a difference toGROUP BY
.The overall deduplication is achieved because
inboxes
is aSet
and not an array.Best way to check that would be via Postgres
EXPLAIN ANALYZE
, I believe.I ran it myself but I also had a look at this Stackoverflow answer.
result of running
EXPLAIN ANALYZE
. tl;dr the query plans are identicalFrom the Stackoverflow answer:
Fun thing just happend, postgres 15 came out and...
Would be nice to see if we're affected.
@ -11,3 +11,3 @@
import { Notes, Users, Instances } from '@/models/index.js';
import { notesChart, perUserNotesChart, instanceChart } from '@/services/chart/index.js';
import { deliverToFollowers, deliverToUser } from '@/remote/activitypub/deliver-manager.js';
import { DeliverManager } from '@/remote/activitypub/deliver-manager.js';
This seems to cause an import error:
103348ee3a
to421b42d07d
@ -140,1 +139,4 @@
manager.addDirectRecipe(remoteUser);
}
if (['public', 'home', 'followers'].contains(note.visibility)) {
Should be
includes
instead ofcontains
.@ -141,0 +143,4 @@
manager.addFollowersRecipe();
}
if (['public', 'home'].contains(note.visibility)) {
Also should be changed to
includes
Also seems like it's spending a lot of time fetching the nodeinfo for every instance, making things very slow
Does seem to work now, albeit it does seem to be spending a lot of time going through all of the dead instances it knows (which I assume would be fixed once #200 is resolved).
Well since the deliver activity includes fetching instance data always, I'm not sure if these things are related?
The nodeinfo thing seems to have resolved itself after a bit but the actual sending of delete activites is still related to the issue of dealing with dead instances since we're now sending those to every known instance.
Just applied this on toast.cafe - let's see how that goes.
So update, it's not a great experience.
I get floods of
[chart] instance:SOME_INSTANCE(hour): New commit created
and
[chart] instance:SOME_INSTANCE: Updated
during which everything basically stops dead for a while.
I wonder exactly what's going on there, and whether that could be stuffed into a priority queue in redis instead 🤔
Those two are the log messages for starting and finishing an update of another instances information (e.g. nodeinfo).