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

Large changeset tables cause website stability issues #334

Open
chillu opened this issue May 26, 2021 · 3 comments
Open

Large changeset tables cause website stability issues #334

chillu opened this issue May 26, 2021 · 3 comments

Comments

@chillu
Copy link
Member

chillu commented May 26, 2021

dev/build can run into issues on active sites where implicit ChangeSet and ChangeSetItem tables can run into tens of millions of rows. Notably this is all background data, very few customers use the "campaigns" feature directly (with ChangeSet.IsInferred=0).

Option 1: Allow disabling of changeset writing (unclear if this is possible without rearchitecting, and whether we want to support that variation)

Option 2: Garbage collection of those records

Option 3: Fix dev/build failure cases (maybe around indexes?)

@maxime-rainville
Copy link
Contributor

Publish recursive uses change set internally.

$changeset = ChangeSet::create();
$changeset->IsInferred = true;
$changeset->Name = _t(
__CLASS__ . '.INFERRED_TITLE',
"Generated by publish of '{title}' at {created}",
[
'title' => $owner->Title,
'created' => DBDatetime::now()->Nice()
]
);
$changeset->write();
$changeset->addObject($owner);

I tried truncating the ChangeSet table to see what happens. The CMS "Publish" action starting throwing errors in my face. After a couple "failed publish", the ChangeSet table put itself back in a state where pages could be published again. This would imply that at least the latest ChangeSet is required for doing a recursive publish ... although I can't tell you why.

Beyond that, it's not clear what the value of keeping those ChangeSet record in the database is. It looks like once upon on time, someone intended ChangeSet to be "revertable".

public function canRevert($member = null)
{
// All changes must be publishable
foreach ($this->Changes() as $change) {
/** @var ChangeSetItem $change */
if (!$change->canRevert($member)) {
return false;
}
}
// Default permission
return $this->can(__FUNCTION__, $member);
}

@kinglozzer
Copy link
Member

Are the dev/build issues triggered when models are added/removed? I’ve had performance issues in the past when the enum values were updated for ChangeSetItem.ObjectClass: silverstripe/silverstripe-framework#8401 (comment). Unfortunately I can’t remember which project I was referring to, or what MySQL version it was running, so I may be barking up the wrong tree here 😄

@brettt89
Copy link

brettt89 commented Jun 8, 2021

From an Operations perspective
dev/build issues relating to this table that I have observed have been mostly related to Framework performing a CHECK TABLE call on these large datasets causing the majority of identified pain during dev/build (E.g. Long build times).

Reference: silverstripe/silverstripe-framework#9966

However there are other issues related to large tables / datasets (e.g. Snapshots / Backups / Database Maintenance / etc) which could also be improved through approaches such as "Garbage Collection".

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

No branches or pull requests

4 participants