Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
See http://drupal.org/node/704446
If user_save fails on slave sites after updating account on master, this should trigger an error message. Ideally we'd roll back the change on master too.
Comment | File | Size | Author |
---|---|---|---|
#5 | 704488-bakery-update-rollback-5.patch | 2.64 KB | coltrane |
Comments
Comment #1
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedThis was patched in CVS:
http://drupal.org/cvs?commit=324210
Comment #2
juliangb CreditAttribution: juliangb commentedJust to clarify this issue, as I was a bit confused on initial reading whether it was fixed:
The commit has added an error message if user_save fails, but the rollback functionality hasn't been done yet.
Comment #3
juliangb CreditAttribution: juliangb commentedMarked #622242: username changes may fail on subsites, breaking the synch as duplicate of this issue.
Comment #4
coltrane1) The master should know that an update has failed
2) The slave should be able to return to the original, un-updated state
1 is handled in Bakery right now but I'm looking at this feature for being able to rollback any failed updates as part of #556666: Sync hooks: Enable sharing of arbitrary data
Implementation thoughts:
For sake of simplicity, I think the slave should just report TRUE/FALSE as to the success of an update, even if the update was partial. If a slave is unresponsive to an update (such as if the slave site is down) the master should assume FALSE. All false updates are recorded and viewable (is watchdog good enough?).
Rolling back an update should happen on the slave. The slave should record the original state and if an update request from the master fails to succeed the slave returns to the saved original state and responds with FALSE.
Comment #5
coltraneHere's a patch for D6 Bakery for rolling back if user_save fails. It stores the previous fields and does a user_save on them should the user_save for the update fail. It also does a watchdog in bakery_user() update to record that the update failed.
Comment #6
gregglesI think the drupal_set_message should be more explicit that the save has been rolled back to previous values as a result of the error from the sub site and suggest that the admin do something to fix the problem with the subsite/communication so they really know that there's a problem.
Comment #7
fuzzy76 CreditAttribution: fuzzy76 commentedWhat if the user account is present at 3 slave sites, and only one of them fails to update? If it's the last slave site receiving the update, wouldn't we need a way to undo the first two as well? I am think it would be easier to figure out why an update can fail instead, and figure out a fallback to make the update succeed.