Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem after Update to 2.1.1 with Data loss #365

Closed
seldimi opened this issue Jul 19, 2022 · 16 comments
Closed

Problem after Update to 2.1.1 with Data loss #365

seldimi opened this issue Jul 19, 2022 · 16 comments

Comments

@seldimi
Copy link

seldimi commented Jul 19, 2022

Hello.
I have read that many users have faced issues with the upgrade. My issue is that upgrade haven’t caused just functionality issues but also data loss.
When I’ve upgraded and was prompted to replace the object-cache.php, then everything seem normal.
Though all the new orders on the website, plus the products data that were running via API import were wrong. Orders are blank (only a few custom meta fields were saved) but lost total billing/shipping data. Like we lost the WC_Order, WC_product properties etc

Even reverting back, I cannot find these data, also checked DB and they were erased as well, even wc_mail logs have empty orders etc.

I had to rollback my website to an older backup

I guess those data are lost for ever.

@tillkruss
Copy link
Member

This has nothing to do with v2.1.1. The split-brain problem occurs when you toggle the object cache one and off, without doing a full cache flush.

@seldimi
Copy link
Author

seldimi commented Jul 19, 2022

Sorry I didn't quite understand. When the droplet is replaced, shouldn't it flash auto?
Also how come I have lost data on over 4k orders and products. If there was just memory conflict it wouldn't wipe db.
That happened to two websites that's why I have reported

@tillkruss
Copy link
Member

No, we don't auto-flush the cache. Can you explain the data points that are lost?

I assume you run backup and can restore the data.

@seldimi
Copy link
Author

seldimi commented Jul 19, 2022

My actions were : update plugin. Replace droplet without flush and leave website.
On the website we run some php crons that use WC_Order and checks order status (or post new orders) to an external service via WooCommerce CRUD.
Similar we use JSONs to read products and update WooCommerce with WC_Product class and CRUD.

I assume that when I ve changed the droplet and I was loaded an order (Eg wc_get_order(21)) and said on php $order->set_status("processing"); $order->save() it couldn't read any other object properties (like billing address, billing email etc) and it removed all these from postmeta table. The only meta data that were not affected are the meta datas added with update_meta_data() method and not WC_Order properties.

I have kept the situation on a staging website in case you want to check further.

@tillkruss
Copy link
Member

What would you want me to check on the staging site?

@seldimi
Copy link
Author

seldimi commented Jul 19, 2022

Dunno. The drop in? To test a writing object. To see how data was lost. Dunno 😁

@tillkruss
Copy link
Member

This is what causes the split-brain problem:

  1. Run the object cache with some data in it
  2. Turn off the object cache
  3. Change data in SQL
  4. Turn on the object cache

Voila, your cache is now out of sync.

@seldimi
Copy link
Author

seldimi commented Jul 19, 2022

My problem is that also data were removed from database. So that could lead to data loss?

@tillkruss
Copy link
Member

This plugin doesn't interact with the database at all, it only provides wp_cache_*() functions for WP core and other plugins to interact with.

So I don't know why your database would be missing data.

We don't even flush the object cache unless you request it to avoid data loss.

@seldimi
Copy link
Author

seldimi commented Jul 19, 2022

I have understood that but how can I tell that was a coincidence on two websites with similar setup and both running on crud objects and ERP bridges.

While having this issue, there were many warnings for get_objecr_vars() on class wp-term 197. When redis was disabled, alla errors disappeared. How to explain that?

@skhaz
Copy link

skhaz commented Jul 19, 2022

I am having the same issue

@CyberCr33p
Copy link

I believe this is what happened:

  1. After the plugin update the website had issues but not completely broken.

  2. PHP script that gets data from an ERP tried to update orders data in postmeta (using woocommerce API) and wrote "empty" data.

If plugin update made the website completely "broken" then it would not be possible the PHP script to connect to wordpress database and it wouldn't cause data loss. But as some website functions were working it didn't "block" the PHP script from connecting to database.

@tillkruss
Copy link
Member

I've tagged v2.1.3 which should resolve all the issues. Give that a try.

@tillkruss
Copy link
Member

I'd also suggest if you're running missing critical applications like large e-commerce operations either a) test free plugins in staging environments, b) don't update to new version on release day, or c) use Object Cache Pro which is unit-tested front to back yo avoid data loss like this.

@furai
Copy link

furai commented Jul 20, 2022

Hey, just a heads up - on official svn repo there's no version v2.1.3 tagged (hence the wpackagist version is stuck at broken 2.1.1). @tillkruss

@tillkruss
Copy link
Member

I'll tag this today for a few hours to see how it goes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants