APC or Memcached might be serving wrong QUIZ info.

APC or Memcached might be serving wrong QUIZ info.

av David Lowe -
Antal svar: 3
Bild av Plugin developers

Hello,

I am seeing some really bizarre results from page loads that when you refresh the page it may or may not be different, for example. I just made a colleague an administrator and after I hit submit he was there. When I refreshed the page he disappeared and it continues like this where things appear and disappear. Another example (which is very critical and fragile) there's a mulitple choice question that is dynamic so different users see different questions. One student entered there answer and continued on. They came back to it later to double check it and the ordering of the answers was different but the answer remained in the same position (b) which then made there answer incorrect. So they changed their answer, refreshed the page and it changed again. So there's a big problem here as exams may or may not be scored correctly. This could result in several grade appeals, not good!

Here's the setup:
We are running Moodle 2.5.1 (Build: 20130830)
We have NetApp under a load balancer that has 2 app instances. They point to a NGINX web server that's connected to PostgreSQL. We have APC Opcode Cache in place as well as Memcached (Couchbase).
For the cache administration we set the Application to use Memcache and the Sessions are stored in the DB.

My theory is one user got to the question and the page was cached. The next user hit the page and got a new question and this updated the currently existing cached page. When the first user went back to one of their questions the info was fetched from cache from the previous users cached page and the info is incorrect.

If this is true how do I fix this? If I'm way off then does anyone have any ideas? fixes?......anything?

Thanks.

Medeltalet av utvärderingarna: -
Som svar till David Lowe

Re: APC or Memcached might be serving wrong QUIZ info.

av Tim Hunt -
Bild av Core developers Bild av Documentation writers Bild av Particularly helpful Moodlers Bild av Peer reviewers Bild av Plugin developers

Where is your memcache cache stored? Which server?

Medeltalet av utvärderingarna: -
Som svar till Tim Hunt

Re: APC or Memcached might be serving wrong QUIZ info.

av David Lowe -
Bild av Plugin developers

Couchbase is stored on another VM on the NetApp.

Some more details on the quiz. There is only 1 attempt allowed and the multiple choice questions have the "Shuffle the choices" enabled.

 

Medeltalet av utvärderingarna: -
Som svar till David Lowe

Re: APC or Memcached might be serving wrong QUIZ info.

av Tim Hunt -
Bild av Core developers Bild av Documentation writers Bild av Particularly helpful Moodlers Bild av Peer reviewers Bild av Plugin developers

OK. My guess was that you had two separate memcache stores, one on each web server connected to as localhost. That might lead to the symptoms you describe, but it sounds like that is not what is happening.

As usual when you have a bug to investigate, there are two things to try:

  1. Get more information. Look in the logs. Turn up Debugging to increase the amount written to the logs. Look in the database logs. Does Couchbase log what it is doing? Add extra debugging code to Moodle to output what is going on.
  2. Try changing something, to see if you can work out what setting is causing the problem. E.g. switch question caching back to File cache store temporarily, to see if that makes the problem go aways. If it does you have helped narrow down the problem.
Medeltalet av utvärderingarna: -