Project V FAQ

 

Running the Grading Scripts (note, we have not tested THESE instructions, our scripts worked when running from our grading directories, etc... you may need to fix paths, etc.)

  1. To run the basic tests using the revised harness...
    a) copy the files in ~cs186/buftest/grading/tester to ~/postgresql-7.2.2/src/tester
    b) inside ~/postgresql-7.2.2/src/tester, run make
    c) run "grade-mru filename" where detailed output goes to filename, if you compiled with MRU files
    d) run "grade-s2q filename" where detailed output goes to filename, if you compiled with S2Q files
  2. To run the real tests using the PostgreSQL backend...
    a) copy ~cs186/buftest/grading/real/pg_config.h.in to ~/postgresql-7.2.2/src/include. This file changes the block size to 512 blocks to induce more page faults.
    b) copy ~cs186/buftest/grading/real/config.cache to ~/postgresql-7.2.2
    c) run ./configure --prefix=/home/cc/cs186/fa02/class/cs186-XX/postgresql-7.2.2/exe (be sure to change path appropriately)
    d) run gmake clean
    e) gmake
    f) gmake install
    h) copy ~cs186/buftest/grading/real/* to some directory
    i) delete $PGDATA directory
    i) run ./runQuery from that directory, it will initdb, create a test database called test, load two tables R and S, and then run two queries, one which puts the results in another table (causing writes) and finally an aggregation over the results. If the count = 917 for the second query, you got full credit.

FAQ

  1. You may find it easier to understand the 2Q psuedocode (in the context of pinning and unpinning pages) if you replace 2 words

    if p is on the Am queue
    then
       put p on the front of the Am queue
    else if p is on the A1 queue
    then ...


    could be read:

    if p WAS on the Am queue
    then
       put p on the front of the Am queue
    else if p WAS on the A1 queue
    then ...


  2. Some definitions
  3. Shared Memory - PostgreSQL stores all the buffers in shared memory so that multiple backends can share the buffers. For this project, your data structures do not need to be in shared memory (so you may use malloc), although if something is already allocated in shared memory, leave it there.
  4. If 2Q tells you to take a page from an empty queue, do the smart thing and take a page from some queue that has pages. Only return NULL if there is no other option.