Page MenuHomePhabricator

Drop "internal id" field, use global ID instead.
Open, LowPublic

Description

When trying to update the record for a remote site, a "duplicate key" error is triggered, because SiteStore tries to save a new row with the same global id, instead of replacing the renaming one. This is caused by the fact that SiteStore uses the "internal id" to decide whether to update or insert. This behavior is dictated by ORMRow, but inappropriate for sites, or anything else that has a native, non-numeric primary key.

We should stop using ORMRow/ORMTable, and remove the internal ID field from the sites table and Site object.

Details

Related Changes in Gerrit:

Event Timeline

daniel raised the priority of this task from to Needs Triage.
daniel updated the task description. (Show Details)
daniel added a project: MediaWiki-Site-system.
daniel subscribed.
Krinkle subscribed.

The first part of this has been done. ORM support was removed in rMWd9d22e8f0b4a: Remove ORM code from core / https://gerrit.wikimedia.org/r/243945.

The "internal ID" still exists in MediaWiki core's Site.php code though. So this task tracks removal of that technical debt.

Change 561118 had a related patch set uploaded (by TheSandDoctor; owner: TheSandDoctor):
[mediawiki/core@master] Remove internalid

https://gerrit.wikimedia.org/r/561118

Where in RELEASE-NOTES-1.35 do you think this should be listed @Krinkle ?

Also: what is this being replaced with code wise? I've noticed usage throughout mediawiki-core

This task is not an easy task for removing old code. It is a (small) upcoming project that Core Platform will likely work on at some point. They might have time to work with you on this but it does not have a ready or easy-to-implement plan that can be acted (yet).

Indeed as you mention, the feature is still used and not ready for removal.

Change #561118 abandoned by Hashar:

[mediawiki/core@master] Remove internalid

https://gerrit.wikimedia.org/r/561118

Change #561118 restored by Thcipriani:

[mediawiki/core@master] Remove internalid

https://gerrit.wikimedia.org/r/561118