]> git.pld-linux.org Git - packages/rpm.git/blobdiff - rpm-db_buffer_small.patch
- release 47
[packages/rpm.git] / rpm-db_buffer_small.patch
index 020aa976996f4a3beb23a640444e0ce2a7f1b688..1c45d3a158e2dacbd92bd9a10bfc9fafd687fcbd 100644 (file)
@@ -7,8 +7,8 @@ See https://bugs.launchpad.net/rpm/+bug/934420 for more information.
 It appears to be some type of a bug in the BerkleyDB 5.3.x.  In an attempt
 to workaround the problem, when we encounter this situation we attempt
 to adjust the size of the mmap buffer until the call works, or we
-end up trying 10 times.  The new size is either the updated vp->size
-from the failed pget call, or the previous size + 1024.
+end up trying 25 times.  The new size is either the updated vp->size
+from the failed pget call, or the previous size + 4096.
 
 If DBI debugging is enabled, additional diagnostics are printed, otherwise
 a basic retry and success message is added to show that the failure was
@@ -39,11 +39,11 @@ Index: rpm-5.4.9/rpmdb/rpmdb.c
                    fprintf(stderr, "==> munmap(%p[%u]) error(%d): %s\n",
                        uh, (unsigned)uhlen, errno, strerror(errno));
 +              /* We want to be sure to limit the number of retry attempts to avoid a loop! */
-+              if (rc == DB_BUFFER_SMALL && retry < 10) {
++              if (rc == DB_BUFFER_SMALL && retry < 25) {
 +                 /* If we got a largr vp-size back, use that, otherwise increment the size by 1k */
-+                 uhlen = vp->size > uhlen ? vp->size : uhlen + 1024;
++                 uhlen = vp->size > uhlen ? vp->size : uhlen + 4096;
 +                 retry++;
-+                 if ((dbi)->dbi_debug)
++                 if (_rpmmi_debug || (dbi)->dbi_debug)
 +                     fprintf(stderr, "==> DB_BUFFER_SMALL orig requested (%d), configured (%d), forcing larger buffer (%d), new size (%d)\n",
 +                          origlen, vp->ulen, uhlen, vp->size);
 +                 else
@@ -52,7 +52,7 @@ Index: rpm-5.4.9/rpmdb/rpmdb.c
 +              }
 +          }
 +          if (retry) {
-+              if ((dbi)->dbi_debug)
++              if (_rpmmi_debug || (dbi)->dbi_debug)
 +                 fprintf(stderr, "==> success orig requested (%d), configured buffer (%d), buffer (%d), size after dbiGet (%d)\n",
 +                      origlen, vp->ulen, uhlen, vp->size);
 +              else
@@ -64,6 +64,15 @@ Index: rpm-5.4.9/rpmdb/db3.c
 ===================================================================
 --- rpm-5.4.9.orig/rpmdb/db3.c
 +++ rpm-5.4.9/rpmdb/db3.c
+@@ -1442,6 +1442,8 @@
+       rc = dbcursor->pget(dbcursor, key, pkey, data, flags);
+       /* XXX DB_NOTFOUND can be returned */
+       _printit = (rc == DB_NOTFOUND ? 0 : _debug);
++//    /* XXX Permit DB_BUFFER_SMALL to be returned (more restrictive?) */
++//    _printit = (rc == DB_BUFFER_SMALL ? 0 : _printit);
+       rc = cvtdberr(dbi, "dbcursor->pget", rc, _printit);
+ #else
+       /* XXX db3 does DB_FIRST on uninitialized cursor */
 @@ -1452,7 +1452,7 @@ assert(db != NULL);
  #endif
      }
This page took 0.026033 seconds and 4 git commands to generate.