The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Instiki Troubles

1 reply on 1 page. Most recent reply: Sep 22, 2004 9:30 AM by James Britt

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Michael Neumann

Posts: 66
Nickname: backflash
Registered: May, 2003

Michael Neumann is fallen in Love with Ruby
Instiki Troubles Posted: Sep 22, 2004 4:41 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Michael Neumann.
Original Post: Instiki Troubles
Feed Title: Mike's Weblog
Feed URL: http://www.ntecs.de/blog-old/index.rss?cat=ruby&count=7
Feed Description: Blogging about Ruby and other interesting stuff.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Michael Neumann
Latest Posts From Mike's Weblog

Advertisement

Random Rollbacks

From time to time our EuRuKo04 Wiki experienced strange and very annoying random rollbacks. After I installed the newest version of Instiki from CVS, which claims to fix this bug, I thought everything is now fine. But only a few days later matju told us that again a random rollback has happened! Now I decided to put an end to these annoying rollbacks and removed the rollback method completely from the controller. Rollbacks, either random or by intention, can now no more happen.

But why was the solution in the CVS of Instiki not enough to prevent random rollbacks? At first let me say that the rollback action is triggered by a simple HTTP GET request. When a web-spider comes along, it usually tries to follow this URL and voila, a random rollback has happened! The CVS version now tried to fix this by first showing a JavaScript message box which forwards to the rollback URL on submission. This means that the URL of the rollback action is no longer inside the HTML, but inside the JavaScript section (which itself is inside the HTML ;-). Two reasons why this could be not enough:

  1. Maybe some web-spiders even crawl the JavaScript sources. I don't believe this is the reason, because it's very hard to distinguish URLs in JavaScript from simple strings especially as the rollback URL is a relative one.
  2. Web-spiders look out for modifications of pages they've visited in the past. So in our case, they've the rollback URL in their database and visit this page regularily to see if it has changed.

Conclusion: Don't do actions via HTTP GET unless you disallow web-spiders or you use session URLs which have a limited time span.

45 Gigabytes

This morning my bother called me by phone: "Hey Mike, what has happended with our server? I can't read my emails!". In the same breath he argued whether the reason could be a filled up harddisk. Quickly I logged in to the server and followed his suggestion and displayed the harddisk capacity via df. Boom! What has happended? My /data and /backup partions had no space left. Then I did a du -ch inside my home directory (which resides on the /data partion) and voila, the ~/instiki/storage/2500 directory was nearly 45 GB in size. I looked into it and saw many many snapshot files. So many, that a rm *.snapshot did not succeed due to too many arguments on the command line. Ruby does not have these limitations, so the one-liner ruby -rfileutils -e 'Dir.glob("*.snapshot") {|i| File.delete i}' did the job.

Conclusion: Madeleine, the main-memory database used by Instiki to store the Wiki, should definitly delete old snapshot files. It might be that a newer version of Madeleine has this already implemented.

Read: Instiki Troubles


James Britt

Posts: 1319
Nickname: jamesbritt
Registered: Apr, 2003

Re: Instiki Troubles Posted: Sep 22, 2004 9:30 AM
Reply to this message Reply
I had seen these issues on the EuRuKo04 site, and was wondering why my chages would vanish after a day or so.

"Don't do actions via HTTP GET unless you disallow web-spiders or you use session URLs which have a limited time span."

Exactly. Actually, REST principals suggest that a GET should never change server state. That should be reserved for a PUT, POST, or DELETE.

Anyway, glad this has been sorted out.

See you in Munich!

Flat View: This topic has 1 reply on 1 page
Topic: Raising funds for a Rails identity Previous Topic   Next Topic Topic: I Heart Google

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use