Jump to content

I broke the wiki! :O


Recommended Posts

Ok, well it's not THAT bad but it's certainly unpleasant at the moment. I ran a search/replace on the wiki as a whole which has gone teeeerribly wrong! Long story short is that I've got 3 or 4 search/replace requests running at the same time for pretty much the same thing. Which means those requests writing over eachother as we speak. It's thousands of edits and whats worse is that it's a slow process. I can see new edits popping up everytime I press recent changes. Argh! I'm probably going to have to upload a backup of the wiki. I made one just before starting the request. Lesson learned!

 

I'll update as soon as I've finished mopping the floor. *looks at horizon* That's a lota floor!

 

P.s.

3000 edits and counting down!

Link to comment

Ugh! I had a bad feeling about this. Restoring a database is haaaard. So many choices. Do I cut the red wire or the green and omg, where did this purple polka-dot wire come from?! :oooo:

 

EDIT:

Restore process complete but I feel uncertain about the whole thing. The wiki should be up to date from the point just before I ran my search/replace. It's just that when I uploaded the backup I made it looked quite a bit smaller in filesize and number of database tables compared to what the original database had. Keep an eye out for missing bits!

Link to comment

lol Flix. What was that again? I'm sorry I missed the first word. :3lmao: Futurama FTW! I do believe the wiki is perfectly fine now. Well at least I finally got to restore a database. I can check that off my list of things I need to know. Heh.

 

As for how this whole mess got started... Funny story! *skeptical murmuring from the crowd* So I ran a search/replace request to replace Damage Types: with [[sacred 2:Damage Types|Damage Types:]] that would effect hundreds of pages. Seeing that not many edits had been done by my search/replace request in the recent changes page, I ran an identical query to see if my request had missed any instances of "Damage Types:". My second request did in fact find that my first had missed some instances sooooo... I ran it again of course! Once again I ran the same query and again it had missed some so I ran a 3rd request! Weeeeeee, right? By now I'm seeing edits in pages that look like:

[[sacred 2:Damage Types|[[sacred 2:Damage Types|[[sacred 2:Damage Types|Damage Types:]]]]]]

Not! what I wanted, haha. So I run a new request to replace [[sacred 2:Damage Types|[[sacred 2:Damage Types|[[sacred 2:Damage Types|Damage Types:]]]]]] with DDDDDDDDDDD thinking that the "|" symbol was corrupting my replace request because the creator of the search/replace tool wrote as much in his help page. It wasn't the cause of the problem after all...

 

Maaaany hundreds of edits later... I realized what was actually happening. I clicked Recent Changes on the wiki and saw all the edits that had been done by the replace request and tagged as being done by me. I clicked Recent Changes again and saw NEW edits done by me. And again I clicked recent changes which again showed evener more and newer edits. By me... The replace request was still running. At about one edit per second which, in the grand scheme of things, is veeery slow. Each of the requests I ran probably had comprised about 800 edits or more. At the rate the request was editing that would take about 13 minutes. I ran several requests... Each time I ran a request the wiki showed me pages that fit the criteria I made to search and replace Damage Types:. But! What it didn't show me is that those pages were already in queue to be replaced. So without realizing soon enough I had begun 4 requests all trailing one after another at the same rate doing the same thing and thereby turning Damage Types: into [[sacred 2:Damage Types|Damage Types:]] then into [[sacred 2:Damage Types|[[sacred 2:Damage Types|Damage Types:]]]] and then into [[sacred 2:Damage Types|[[sacred 2:Damage Types|[[sacred 2:Damage Types|Damage Types:]]]]]]...

The way the search/replace tool is processed is definitely not what I would expect. It runs far too slowly which is what threw me off. Directly through the database the process would have taken maybe 10 seconds. On the wiki and as an extension tool the author of the tool has designed it to operate very slowly so as not to bog down a wiki. It's a nice thoughtful idea but we have a decent server for our wiki which can handle much more. So I'll be tweaking the tool in the near future that's for sure! Lesson learned. :blush:

Link to comment

Eeeww.. That is an ugly thing.. You might try, next time, adding a space in front of or behind the end of the phrase you want to replace.

 

E.g.:

 

"Damage Types:" should read " Damage Types: " or "Damage Types: " Note - there is a space before and/or after the phrase.

 

Why:

 

SQL is a very literal language. Literal to the point of being almost anal retentive. This has it's plusses and minuses. By doing the extra space thing, you're covering both instances where there is a space before the first word and those where there isn't a space in front. This should eliminate the recursive nature of your SQL query that is repeating the fix on already fixed stuff.

 

The only time this may fail is if there isn't a space afterwards.

 

There's one other potential danger here. There's a wiki rule, IIRC that you only need to make the first instance of a linkable word or phrase into a link. By running the query willy nilly, you likely turned EVERY instance of "Damage Types" into a link. So if you have a page that talks extensively about Damage Types, like the Damage Types page, you're likely to have a TON of extra links per page.

 

Thinking this sort of thing might be better done manually.

It's a pretty massive super power. I think Schot's fingers will tremble if something else this big has to be run through the Wiki, which, as he stated, is starting to get HUGE

 

:)

 

Gogo

Link to comment

Eeeww.. That is an ugly thing.. You might try, next time, adding a space in front of or behind the end of the phrase you want to replace.

 

E.g.:

 

"Damage Types:" should read " Damage Types: " or "Damage Types: " Note - there is a space before and/or after the phrase.

 

Why:

 

SQL is a very literal language. Literal to the point of being almost anal retentive. This has it's plusses and minuses. By doing the extra space thing, you're covering both instances where there is a space before the first word and those where there isn't a space in front. This should eliminate the recursive nature of your SQL query that is repeating the fix on already fixed stuff.

 

The only time this may fail is if there isn't a space afterwards.

 

There's one other potential danger here. There's a wiki rule, IIRC that you only need to make the first instance of a linkable word or phrase into a link. By running the query willy nilly, you likely turned EVERY instance of "Damage Types" into a link. So if you have a page that talks extensively about Damage Types, like the Damage Types page, you're likely to have a TON of extra links per page.

 

Thinking this sort of thing might be better done manually.

Great tips wolfie, thanx! Unfortunately for my query, Damage Types:, there were no spaces before or after. Though there was a colon which I included in my query in addition to restricting the query to the Sacred 2 namespace and also restricting it to within the Sacred 2 Enemies in Ancaria category of pages. The problem wasn't so much of "running the query willy nilly" as you said it. It was that the amount of time needed to complete the query was unexpected. The simple solution is just to run it once and then allow it to complete which would probably take an hour or two without much impact in the performance of SacredWiki. As for expanding the SQL query I'm a bit limited in the extent of expressions I can use. The tool I'm using is very limited in that regard, meant for relatively simple find/replace tasks. When all is said and done though, I don't think I'll run this query again but rather save it for more important tasks such as minimizing the redirects we have or finally getting rid of non-uploaded images that we have on the wiki. To be continued!

 

 

lol Flix. What was that again? I'm sorry I missed the first word. :3lmao: Futurama FTW! I do believe the wiki is perfectly fine now. Well at least I finally got to restore a database. I can check that off my list of things I need to know. Heh.

Phew. Wasn't sure if it could be edited again. There's still a big green error banner up on the Wiki.

Sorry about that message Flix. I had removed that message the day I posted that the wiki was ok but unfortunately individual browser caches sometimes hold onto stuff longer than they need to. gogo had the same problem. I'll try a few tricks to make sure messages appear and disappear more quickly when using that form of communication. :)

  • Like! 1
Link to comment

Didn't even consider that Schot! It seems like Firefox usually shreds my cache and cookies almost immediately. I was also only noticing it when I was NOT logged in.

Link to comment

Green Poutine? ^^

 

Aaaaah. Ok. Then that's our new file caching system that I started up a week or so ago. It creates static pre-rendered pages of the wiki to guests only. The idea being to reduce the size of our database and to reduce the amount of bandwidth the wiki goes through from visitors viewing/downloading content. I was wondering what sort of bumps in the road we might run into after starting the file cache system. I guess you found the first bump. :D I'll see if I can purge that bit of cache from the system.

Link to comment

Well at least you didn't delete everything from a college server like my sister did once. IT person forgot to change something, and she hit the delete button twice in a row at the worst possible time and did the maximum damage possible. Of course, being almost completely computer illiterate, she had absolutely no idea what she was doing. Mainframe was completely wiped and all that was left was an incomplete backup.

That is an example of Murphy's Laws in action.

I'm feeling a bit burnt out at the moment. Eventually that will pass.

Link to comment

That's my biggest nightmare right there, lol. Your sister must have been absolutely devastated. I don't even want to imagine how I would feel... We do LOTS of backups of the forum and the wiki PLUS our server admin has a constant 7 day backup feature in place. Anytime I'm about to do something that will alter the database I run a backup first. This is the first time ever that the practice actually came into use. Database work is quite unnerving for me, haha. Hope you feel better soon Ysne.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...
Please Sign In or Sign Up