What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hi all, a question regarding synchronization: how can I force the regeneration of data for the `spy_

U01SE4SRCU9
U01SE4SRCU9 Posts: 68 πŸ§‘πŸ»β€πŸš€ - Cadet
edited October 2021 in Help

Hi all,
a question regarding synchronization: how can I force the regeneration of data for the spy_product_abstract_image_storage table? I tried using console event:trigger -r product_abstract_image, but that didn't seem to help.
The core issue is that I'm deleting duplicated image assignments from the spy_product_image_set_to_product_image table via plain SQL (as the query for it is a bit complex for propel) and or course I'd like to synchronize the changes to the FE too. Still, spy_product_abstract_image_storage still has the old data, with the duplicated images and so FE doesn't get updated correctly. How can I force a recheck of what's actually in the DB and recompilation of data for the storage table according to that?

Comments

  • U01LKKBK97T
    U01LKKBK97T Posts: 287 πŸ§‘πŸ»β€πŸš€ - Cadet

    Isn't it console publish:trigger-events ?

  • U01SE4SRCU9
    U01SE4SRCU9 Posts: 68 πŸ§‘πŸ»β€πŸš€ - Cadet

    I don't have anything starting with publish in the console commands selection.

  • U01LKKBK97T
    U01LKKBK97T Posts: 287 πŸ§‘πŸ»β€πŸš€ - Cadet

    I can only tell how it works in Docker. You're probably not using Docker, are you?

  • U01SE4SRCU9
    U01SE4SRCU9 Posts: 68 πŸ§‘πŸ»β€πŸš€ - Cadet

    Nope. Vagrant.

  • U01A5ARAXP0
    U01A5ARAXP0 Posts: 119 πŸ§‘πŸ»β€πŸš€ - Cadet

    you can also truncate the storage table and run that command again

  • U01LKKBK97T
    U01LKKBK97T Posts: 287 πŸ§‘πŸ»β€πŸš€ - Cadet

    Truncating shouldn't be needed actually, but yes, give it a try.
    Also check that your Jenkins and RabbitMQ are up and running.

  • U01SE4SRCU9
    U01SE4SRCU9 Posts: 68 πŸ§‘πŸ»β€πŸš€ - Cadet

    Both are up and running, yes.

    However, truncating - or, rather, deleting just the related rows - did help indeed, thanks. πŸ‘

  • U01A5ARAXP0
    U01A5ARAXP0 Posts: 119 πŸ§‘πŸ»β€πŸš€ - Cadet

    πŸ‘

  • giovanni.piemontese
    giovanni.piemontese Spryker Solution Partner Posts: 871 πŸ§‘πŸ»β€πŸš€ - Cadet

    If u truncate the table just so and then populate the storage table again with the command u can have the problem that u have still old data in KV Storage...
    normally u have in this case try to delete duplicate images with a console command and use the propel entity to delete it or just plain sql and trigger the related events... then everything happend automatically in background..

  • U01A5ARAXP0
    U01A5ARAXP0 Posts: 119 πŸ§‘πŸ»β€πŸš€ - Cadet

    yes, that would help to unpublish old data

  • U01SE4SRCU9
    U01SE4SRCU9 Posts: 68 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited October 2021

    @UL65CH0MC That's exactly what I want to do. The deletion is being done by a console command I created. However, as mentioned I'm using plain SQL for that, not propel. What do you mean with "related events"? I did trigger product_abstract_image (as the images were associated with abstract products) but it didn't do anything until I didn't delete their preexisting storage table entries too (then, however, it worked and KV was ok too)

  • U01A5ARAXP0
    U01A5ARAXP0 Posts: 119 πŸ§‘πŸ»β€πŸš€ - Cadet

    if you use propel, entity events are triggered that most likely the product image storage is listening to. So, if you delete a record using propel, a delete entity event is emitted, and some listener would call unpublish after that

  • U01SE4SRCU9
    U01SE4SRCU9 Posts: 68 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited October 2021

    @U01A5ARAXP0 Problem with that is that my query is relatively complex, with multiple subselects, postgresql functions and whatnot and it would be very time-consuming to translate it to propel (that's a recurring problem I have... propel should make things easier in theory, but in practice, I can get what I want with plain SQL very quickly, even if the query is more complex, but with propel it takes ages (to put the propel query itself together)).

  • giovanni.piemontese
    giovanni.piemontese Spryker Solution Partner Posts: 871 πŸ§‘πŸ»β€πŸš€ - Cadet

    With propel delete entity it happened automatically. With plain sql u have to get from sql the ids of products involved in the cleanup process and trigger the event that u mentioned above

  • U01SE4SRCU9
    U01SE4SRCU9 Posts: 68 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited October 2021

    @UL65CH0MC I tried that too (triggering the event specifically for the ids affected), but again, as long as the preexisting storage table entries were left in place, nothing happened, it did not recheck and recompile the data for the table and, consequently, didn't update FE either.