Last modified: 2014-11-08 00:41:30 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T66306, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 64306 - IdGenerator should skip "used" IDs.
IdGenerator should skip "used" IDs.
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
WikidataRepo (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Wikidata bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-04-23 19:00 UTC by Daniel Kinzler
Modified: 2014-11-08 00:41 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Daniel Kinzler 2014-04-23 19:00:09 UTC
When generating the next ID for some kind of entity, IdGenerator should check whether that supposedly new ID was already used after all, and discard it if so. This process should be repeated a limited number of times, and an exception raised of no unused ID could be found with some fixed number of tried.

An ID is considered "used" if an EntityTitleLookup returns a Title object for that ID, and a call to exists() on that title returns true.

The rationale is that entities with IDs beyond the current counter may be created on a wiki via importing. Checking whether the "next" ID was already used prevents nasty conflicts and errors when such imported entities exist on a wiki. The cost should be relatively low, since new IDs are not often needed, checking is relatively cheap, and conflicts very rare.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links