deep-foundation / deeplinks

https://discord.gg/deep-foundation
The Unlicense
14 stars 9 forks source link

Infinite deleting #267

Open FreePhoenix888 opened 11 months ago

FreePhoenix888 commented 11 months ago

Description

I have a lot of links (67538) and their deletion takes a lot of time

Gql mutation

mutation MyQuery {
      delete_links(where:{
        id:{
          _gt: 1000
        }
      }) {
        affected_rows
      }
    }

Result

image I am waiting for my result more than a minute and it is not finished yet

Additional Info

Note that my deep is working: image I have got amount of created links by using this code:

import { DeepClient } from "@deep-foundation/deeplinks/imports/client.js";
import { generateApolloClient } from '@deep-foundation/hasura/client.js';

const apolloClient = generateApolloClient({
  path: MY_PATH, 
  ssl: true,
});

const unloginedDeep = new DeepClient({ apolloClient });
const guest = await unloginedDeep.guest();
const guestDeep = new DeepClient({ deep: unloginedDeep, ...guest });
const admin = await guestDeep.login({
  linkId: await guestDeep.id('deep', 'admin'),
});
const deep = new DeepClient({ deep: guestDeep, ...admin });
console.log(await deep.select({}).then((result) => result.data.length))

I have tried to check amount of links during deletion process but amount, in opposite, is increased to 67553. Why am not I able to delete links?

FreePhoenix888 commented 11 months ago

I also have Infinite remigrating - https://github.com/deep-foundation/deeplinks/issues/268

Konard commented 11 months ago

It may be possible that links are actually deleted, but because there is timeout around 60 second per request you does not get a result. I would suggest to decrease an amount of deleted links per batch request.

FreePhoenix888 commented 11 months ago

It may be possible that links are actually deleted, but because there is timeout around 60 second per request you does not get a result. I would suggest to decrease an amount of deleted links per batch request.

Why deletion of 60000 takes more than a minute?

FreePhoenix888 commented 10 months ago

https://github.com/deep-foundation/deeplinks/issues/268#issuecomment-1806835034 Maybe this issue would be resolved be restart too, but I have no ability to check it now because I have remigrated

Konard commented 10 months ago

Screenshot_20231119_150122

Sometimes links may be deleted in days...

Screenshot_20231119_152309

At the same time, mp table grew from 6 GB to 39 GB.