[613] in Coldmud discussion meeting

root meeting help first previous next last

a fix and a speedup

daemon@ATHENA.MIT.EDU (Mon Dec 5 13:07:39 1994 )

From: crag@serial.io.com (Crag@JHM)
To: coldstuff@MIT.EDU
Date: Mon, 5 Dec 1994 12:08:12 -0600 (CST)

Colin and I were playing with the server last night and finally narrowed down
 a disappearing object bug to the point of squashing it. It can be easily
 reproduced in the old server with the following:

as $sys eval var o; for o in [1..1000] create([$root]);
;;var o; for o in [db_top() - 1000..db_top()-1] if (!valid(o)) .tell(tostr(o));

THe first 500 or so objects will be invalid.

Here's the fix:

*** src/object.c	Wed Sep  7 21:26:30 1994
--- object.c	Sun Dec  4 21:08:33 1994
*** 119,124 ****
--- 119,125 ----
      cnew->num_idents = 0;
      cnew->search = 0;
+     cnew->dirty = 1;
      /* Add this object to the children list of parents. */
      object_update_parents(cnew, list_add);

object_new() wasn't marking objects as dirty when it created them. I suspect
 this may fix the 'disappearing object' problem experienced wen starting from
 textdumps with lots of objects in them.

While testing the caching code, Colin noticed that $sys and $root were being
 pushed around a lot when it can be assumed that they will need to be active
 all the time. He suggested that their refcounts be incremented so that they
 are always active, thereby turning all cache_retreives and cache_discards of
 those objects into refcount adjustments, rather than taking them off the
 active chain.

Before Jordan's changes this would have caused a server panic because the
 server used to require that there be no active objects at the end of a task.
 Jordan removed this requirement when he added tasking. This may have been
 a mistake. I don't know what happens when too many objects are active. Oh

Anyway, the following patch will prevent #0 and #1 from being inactive. It will
 also (I believe) never put them back on disk. If you make a change to them you
 will have to do a textdump or binary_dump to save the change.

*** src/main.c	Wed Sep  7 21:26:29 1994
--- main.c	Sun Dec  4 22:24:18 1994
*** 136,141 ****
--- 136,146 ----
+     /* hm */
+     cache_retrieve(SYSTEM_DBREF);
+     cache_retrieve(ROOT_DBREF);
      /* Send a startup message to the system object. */
      arg.type = LIST;
      arg.u.list = args;

Consider yourself warned. The first patch is a fix, the second may be a new
 bug. :)

Crag / Robert de Forest