🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #81422

Re: [PATCH] Regarding overview creation and the active file.

#81422
From: D. Stussy
Date: Fri, 19 Jun 2009 19:42
89 lines
4413 bytes
Better patch - found the problem with group expiry creating the skipped
groups.  Note the addition of the final section.

DIRECTORY:  storage/tradindexed/
diff -u tdx-data.c*
--- tdx-data.c  2009-05-21 20:08:33.000000000 +0000
+++ tdx-data.c.mod      2009-06-19 11:00:14.000000000 +0000
@@ -1055,10 +1055,12 @@

     /* Check the inode of the index. */
     if (data->indexinode != index->indexinode) {
-        warn("tradindexed: index inode mismatch for %s: %lu != %lu",
group,
-             (unsigned long) data->indexinode,
-             (unsigned long) index->indexinode);
-        if (fix) {
+        if (index->indexinode) {
+            warn("tradindexed: index inode mismatch for %s: %lu != %lu",
group,
+                 (unsigned long) data->indexinode,
+                 (unsigned long) index->indexinode);
+        }
+        if (fix || !index->indexinode) {
             index->indexinode = data->indexinode;
             changed = true;
         }
diff -u tdx-group.c*
--- tdx-group.c 2009-05-21 20:08:33.000000000 +0000
+++ tdx-group.c.mod     2009-06-19 11:05:13.000000000 +0000
@@ -658,10 +658,12 @@
     entry->count = 0;
     entry->flag = *flag;
     data = tdx_data_new(group, index->writable);
-    if (!tdx_data_open_files(data))
-        warn("tradindexed: unable to create data files for %s", group);
-    entry->indexinode = data->indexinode;
-    tdx_data_close(data);
+    if (strchr("=xj",*flag) == NULL) {
+        if (!tdx_data_open_files(data))
+            warn("tradindexed: unable to create data files for %s",
group);
+        entry->indexinode = data->indexinode;
+        tdx_data_close(data);
+    }
     index_add(index, entry);

     index_lock(index->fd, INN_LOCK_UNLOCK);
@@ -765,8 +767,10 @@
             index_lock_group(index->fd, offset, INN_LOCK_UNLOCK);
             goto fail;
         }
-        if (entry->indexinode != data->indexinode)
-            warn("tradindexed: index inode mismatch for %s", group);
+        if (entry->indexinode != data->indexinode) {
+            if (!entry->indexinode) entry->indexinode = data->indexinode;
+            else warn("tradindexed: index inode mismatch for %s", group);
+        }
         high = entry->high;
         base = entry->base;
         index_lock_group(index->fd, offset, INN_LOCK_UNLOCK);
@@ -805,9 +809,11 @@
     if (entry->indexinode != data->indexinode) {
         if (!tdx_data_open_files(data))
             goto fail;
-        if (entry->indexinode != data->indexinode)
-            warn("tradindexed: index inode mismatch for %s",
+        if (entry->indexinode != data->indexinode) {
+            if (!entry->indexinode) entry->indexinode = data->indexinode;
+            else warn("tradindexed: index inode mismatch for %s",
                  HashToText(entry->hash));
+        }
         data->base = entry->base;
     }

@@ -919,6 +925,10 @@
         tdx_index_close(index);
         return false;
     }
+
+    if (!entry->indexinode) return true;
+    /* Since there was no inode for this group, there was nothing to do!
*/
+
     tdx_index_rebuild_start(index, entry);

     /* tdx_data_expire_start builds the new IDX and DAT files and fills in
the

Technical Details
Message-ID: <h1gpnn$eio$1@snarked.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.CARNet.hr!de-l.enfer-du-nord.net!news.enother.com!news.snarked.org!not-for-mail
References: <h16rde$stb$1@snarked.org> <87hbyhx90e.fsf@windlord.stanford.edu> <h1fuea$b2d$1@snarked.org>

Show Full Headers
Complete Article Headers
Message-ID: <h1gpnn$eio$1@snarked.org>
Subject: Re: [PATCH] Regarding overview creation and the active file.
Date: Fri, 19 Jun 2009 12:42:48 -0700
From: "D. Stussy" <spam@bde-arc.ampr.org>
References: <h16rde$stb$1@snarked.org> <87hbyhx90e.fsf@windlord.stanford.edu> <h1fuea$b2d$1@snarked.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.CARNet.hr!de-l.enfer-du-nord.net!news.enother.com!news.snarked.org!not-for-mail
Newsgroups: news.software.nntp
Lines: 89
Reply-To: "D. Stussy" <replies@newsgroups.kd6lvw.ampr.org>
NNTP-Posting-Host: pool-71-118-50-95.lsanca.dsl-w.verizon.net
X-Trace: snarked.org 1245440567 14936 71.118.50.95 (19 Jun 2009 19:42:47 GMT)
X-Complaints-To: newsmaster@snarked.org
NNTP-Posting-Date: Fri, 19 Jun 2009 19:42:47 +0000 (UTC)
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1478
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1478