[packages/rpm] - silence DB_BUFFER_SMALL workaround messages, but increase additional memory to 4096 and number o
baggins
baggins at pld-linux.org
Thu Sep 20 22:01:26 CEST 2012
commit 1c15eec533ad45c4d20ebdc6e1f9cfc12ef58531
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Thu Sep 20 22:00:28 2012 +0200
- silence DB_BUFFER_SMALL workaround messages, but increase additional
memory to 4096 and number of iterations to 25
- rel 0.22
rpm-db_buffer_small.patch | 25 +++++++++++++++++--------
rpm.spec | 2 +-
2 files changed, 18 insertions(+), 9 deletions(-)
---
diff --git a/rpm.spec b/rpm.spec
index 1efbb19..5de0101 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -43,7 +43,7 @@ Summary(ru.UTF-8): Менеджер пакетов от RPM
Summary(uk.UTF-8): Менеджер пакетів від RPM
Name: rpm
Version: 5.4.10
-Release: 0.21
+Release: 0.22
License: LGPL
Group: Base
# http://rpm5.org/files/rpm/rpm-5.4/rpm-5.4.10-0.20120706.src.rpm
diff --git a/rpm-db_buffer_small.patch b/rpm-db_buffer_small.patch
index 020aa97..0ca794a 100644
--- a/rpm-db_buffer_small.patch
+++ b/rpm-db_buffer_small.patch
@@ -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,24 +39,24 @@ 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
-+ fprintf(stderr, "==> retry (%d) db3cpget (%d)\n", retry, uhlen);
++ rpmlog(RPMLOG_DEBUG, D_("==> retry (%d) db3cpget (%d)"), retry, uhlen);
+ goto retry_get;
+ }
+ }
+ 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
-+ fprintf(stderr, "==> success\n");
++ rpmlog(RPMLOG_DEBUG, D_("==> success"));
}
}
} 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
}
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/rpm.git/commitdiff/1c15eec533ad45c4d20ebdc6e1f9cfc12ef58531
More information about the pld-cvs-commit
mailing list