Topic on Project:Support desk

Jump to navigation Jump to search

Files aren't populating categories without a null edit on slave servers

5
T0lk (talkcontribs)

I have a server in the US which acts as the master, and slaves in Asia and Europe. Everything works as expected, except if a user on either slave adds a category to a file, that file never appears in the category page.

Steps to get the image to appear on the category from the slave server: 1) Perform a null edit on the file page. 2) Purge the cache of the category page. Occasionally the file will appear without having to do the null edit, sometimes several null edits are necessary for the file to appear.

If the category doesn't exist the images appear on the first page load of the new category. The wiki in question has about 10,000 files with extensive categorization. I'm not able to reproduce the problem on any other wikis which also exists on the slave servers and share configuration files. But those wiki's don't have very many files on them. How can I go about troubleshooting this?

Bawolff (talkcontribs)

please define how your using the term master/slave here (in a traditional db master/slave setup, the slaves are readonly, so saying "make an edit on a slave" would be an oxymoron)

T0lk (talkcontribs)

You're right, sorry. The traditional setup so the slave is readonly and edits are passed to the server in the US. What I mean is the actions when the origin is the slave server have this problem, but not when the origin is the master server. The slave servers are configured with wgDBservers.

Bawolff (talkcontribs)

Could you be more specific? What exactly is $wgDBServers (and other related variables) set to [Of course, redacting anything sensitive]? Do you have multiple apache/whatever web server you are using? What is your (object) caching configuration look like? Are you using memcache? What is $wgMainCacheType and $wgParserCacheType set to?


Note: If you are using either varnish or file cache, this might be caused by phab:T26575

T0lk (talkcontribs)

Each server is running ubuntu/nginx/mariadb with Mediawiki 1.34.

Master:

$wgServer           = "https://example.com";
$wgDBtype           = "mysql";
$wgDBserver         = "localhost";
$wgDBname           = "wikidb";
$wgDBuser           = "wiki_user";
$wgDBpassword       = "mypassword";


Slaves:

$wgServer           = "https://example.com";
$wgDBservers = [

    [
        'host' => "172.xx.x.xxx",
        'dbname' => "wikidb",
        'user' => "wiki_user",
        'password' => "mypassword",
        'type' => "mysql",
        'flags' => DBO_DEFAULT,
        'load' => 0,
    ],
    [
        'host' => "localhost",
        'dbname' => "wikidb",
        'user' => "wiki_user",
        'password' => "mypassword",
        'type' => "mysql",
        'flags' => DBO_DEFAULT,
        'load' => 1,
    ],


];
$wgDBname           = "wikidb";

Each server has the same cache setup, including file cache:

$wgMainCacheType = CACHE_MEMCACHED;
$wgParserCacheType = CACHE_MEMCACHED; 
$wgMessageCacheType = CACHE_MEMCACHED; 
$wgMemCachedServers = array( "127.0.0.1:11211" );
$wgSessionCacheType = CACHE_MEMCACHED; 

$wgUseFileCache = true;
$wgCacheDirectory = '/home/PrivateCache/xxxx';
$wgFileCacheDirectory = '/home/PrivateCache/xxxx';

I experimented with commenting out the above cache settings on all servers, but this did not solve the problem. If it matters, the memcached servers do not communicate across regions. I narrowed down the steps to reproduce a little. If I load a random image while on a slave server, then add any number of categories everything works as expected. If I delete and add a category at the same time, that is when a null edit is necessary to get the image to show up. From looking at other user's edits, images are not appearing in categories after initial upload either.

Reply to "Files aren't populating categories without a null edit on slave servers"