Migrasi aktor

From mediawiki.org
This page is a translated version of the page Actor migration and the translation is 32% complete.
Outdated translations are marked like this.

Secara historis, MediaWiki telah menyimpan referensi ke pengguna (seperti penulis revisi atau sebuah gambar) sebagai sebuah pasangan [<id>, <name>] , dengan [0, <IP address>] untuk penyuntingan secara anonim. Ini tentunya merupakan pemborosan ruang penyimpanan dan menyebabkan masalah kinerja pada wiki yang revisinya berjumlah besar, serta mempersulit penggantian nama pengguna atau memperkenalkan jenis penulis baru seperti T133452. MediaWiki 1.31 introduces the concept of actors (someone who makes an action, such as an edit or a log event; currently either a registered user or an anonymous one), and a migration process towards a new database schema, with fields like revision.rev_user and revision.rev_user_text replaced by fields like revision.rev_actor. Due to the huge size of the English Wikipedia revision table, which had be fully migrated before the changes can be cleaned up, the migration was done gradually, over several MediaWiki releases. Ini diharapkan rampung pada MediaWiki 1.34.

The migration created a actor table record for every distinct *_user / *_user_text pair, and replaced those pairs with a reference to the actor row ID. The following columns were migrated:

Tabel Kolom lama Kolom baru
revision rev_user, rev_user_text rev_actor
archive ar_user, ar_user_text ar_actor
ipblocks ipb_by, ipb_by_text ipb_by_actor
image img_user, img_user_text img_actor
oldimage oi_user, oi_user_text oi_actor
filearchive fa_user, fa_user_text fa_actor
recentchanges rc_user, rc_user_text rc_actor
logging log_user, log_user_text log_actor

To avoid a costly ALTER TABLE on the extremely huge revision tables of large Wikipedia wikis, rev_user and rev_user_text were initially copied to the revision_actor_temp table and from there back to revision. Tabel revision_actor_temp akan didrop setelahnya.

If you are a wiki owner, you probably don't need to do anything; the migration will happen automatically when you run update.php. If you want to control when the migration happens, see $wgActorTableSchemaMigrationStage and the migrateActors.php maintenance script.

If you are an extension developer, and your extension does direct DB access to some of the affected fields, you'll need to update your queries (and ideally use the getQueryInfo() methods, such as Revision::getQueryInfo(), instead of manually constructing your query). During the migration period, you can also use the ActorMigration class to get schema/field information that respects any $wgActorTableSchemaMigrationStage settings.

If you are a tool developer using Toolforge , there might be performance implications, even if you don't use any of the affected fields directly. See wikitech:News/Actor storage changes on the Wiki Replicas for additional information.