Quellcode durchsuchen

db47: Update to 4.7.25.4

Signed-off-by: Marcel Denia <naoir@gmx.net>
Marcel Denia vor 10 Jahren
Ursprung
Commit
aa90b27693

+ 6
- 4
libs/db47/Makefile Datei anzeigen

@@ -8,12 +8,14 @@
8 8
 include $(TOPDIR)/rules.mk
9 9
 include $(INCLUDE_DIR)/uclibc++.mk
10 10
 
11
+BASE_VERSION:=4.7.25
12
+
11 13
 PKG_NAME:=db47
12
-PKG_VERSION:=4.7.25.NC
13
-PKG_RELEASE:=6
14
+PKG_VERSION:=$(BASE_VERSION).4.NC
15
+PKG_RELEASE:=1
14 16
 
15
-PKG_BUILD_DIR:=$(BUILD_DIR)/db-$(PKG_VERSION)
16
-PKG_SOURCE:=db-$(PKG_VERSION).tar.gz
17
+PKG_BUILD_DIR:=$(BUILD_DIR)/db-$(BASE_VERSION).NC
18
+PKG_SOURCE:=db-$(BASE_VERSION).NC.tar.gz
17 19
 PKG_SOURCE_URL:=http://download.oracle.com/berkeley-db/
18 20
 PKG_MD5SUM:=073ab7f20d24b3872a51ca762f5090e7
19 21
 

libs/db47/patches/001-sequence_lock.patch → libs/db47/patches/010-patch.4.7.25.1.patch Datei anzeigen

@@ -1,7 +1,6 @@
1
-diff -ruN db-4.7.25.NC/sequence/sequence.c db-4.7.25.NC.new/sequence/sequence.c
2
---- db-4.7.25.NC/sequence/sequence.c	2008-05-05 22:25:09.000000000 +0200
3
-+++ db-4.7.25.NC.new/sequence/sequence.c	2009-11-08 12:50:27.000000000 +0100
4
-@@ -187,7 +187,11 @@
1
+--- a/sequence/sequence.c
2
++++ b/sequence/sequence.c
3
+@@ -187,7 +187,11 @@ __seq_open_pp(seq, txn, keyp, flags)
5 4
  	if ((ret = __db_get_flags(dbp, &tflags)) != 0)
6 5
  		goto err;
7 6
  
@@ -14,7 +13,7 @@ diff -ruN db-4.7.25.NC/sequence/sequence.c db-4.7.25.NC.new/sequence/sequence.c
14 13
  		ret = __db_rdonly(dbp->env, "DB_SEQUENCE->open");
15 14
  		goto err;
16 15
  	}
17
-@@ -244,6 +248,11 @@
16
+@@ -244,6 +248,11 @@ retry:	if ((ret = __db_get(dbp, ip,
18 17
  		if ((ret != DB_NOTFOUND && ret != DB_KEYEMPTY) ||
19 18
  		    !LF_ISSET(DB_CREATE))
20 19
  			goto err;
@@ -26,7 +25,7 @@ diff -ruN db-4.7.25.NC/sequence/sequence.c db-4.7.25.NC.new/sequence/sequence.c
26 25
  		ret = 0;
27 26
  
28 27
  		rp = &seq->seq_record;
29
-@@ -296,7 +305,12 @@
28
+@@ -296,7 +305,12 @@ retry:	if ((ret = __db_get(dbp, ip,
30 29
  	 */
31 30
  	rp = seq->seq_data.data;
32 31
  	if (rp->seq_version == DB_SEQUENCE_OLDVER) {
@@ -40,7 +39,7 @@ diff -ruN db-4.7.25.NC/sequence/sequence.c db-4.7.25.NC.new/sequence/sequence.c
40 39
  		if (!F_ISSET(env, ENV_LITTLEENDIAN)) {
41 40
  			if (IS_DB_AUTO_COMMIT(dbp, txn)) {
42 41
  				if ((ret =
43
-@@ -707,6 +721,13 @@
42
+@@ -707,6 +721,13 @@ __seq_get(seq, txn, delta, retp, flags)
44 43
  
45 44
  	MUTEX_LOCK(env, seq->mtx_seq);
46 45
  

libs/db47/patches/002-lock.patch → libs/db47/patches/020-patch.4.7.25.2.patch Datei anzeigen

@@ -1,7 +1,6 @@
1
-diff -urN db-4.7.25.NC/lock/lock.c db-4.7.25.NC.new/lock/lock.c
2
---- db-4.7.25.NC/lock/lock.c	2008-05-07 14:27:35.000000000 +0200
3
-+++ db-4.7.25.NC.new/lock/lock.c	2009-11-08 12:52:19.000000000 +0100
4
-@@ -1274,10 +1274,12 @@
1
+--- a/lock/lock.c
2
++++ b/lock/lock.c
3
+@@ -1274,10 +1274,12 @@ __lock_put_internal(lt, lockp, obj_ndx,
5 4
  		SH_TAILQ_REMOVE(
6 5
  		    &lt->obj_tab[obj_ndx], sh_obj, links, __db_lockobj);
7 6
  		if (sh_obj->lockobj.size > sizeof(sh_obj->objdata)) {
@@ -16,7 +15,7 @@ diff -urN db-4.7.25.NC/lock/lock.c db-4.7.25.NC.new/lock/lock.c
16 15
  		}
17 16
  		SH_TAILQ_INSERT_HEAD(
18 17
  		    &FREE_OBJS(lt, part_id), sh_obj, links, __db_lockobj);
19
-@@ -1467,15 +1469,21 @@
18
+@@ -1467,15 +1469,21 @@ retry:	SH_TAILQ_FOREACH(sh_obj, &lt->obj
20 19
  		if (obj->size <= sizeof(sh_obj->objdata))
21 20
  			p = sh_obj->objdata;
22 21
  		else {

libs/db47/patches/003-dead_lock.patch → libs/db47/patches/030-patch.4.7.25.3.patch Datei anzeigen

@@ -1,7 +1,6 @@
1
-diff -urN db-4.7.25.NC/lock/lock_deadlock.c db-4.7.25.NC.new/lock/lock_deadlock.c
2
---- db-4.7.25.NC/lock/lock_deadlock.c	2008-03-10 14:31:33.000000000 +0100
3
-+++ db-4.7.25.NC.new/lock/lock_deadlock.c	2009-11-08 12:53:25.000000000 +0100
4
-@@ -121,7 +121,7 @@
1
+--- a/lock/lock_deadlock.c
2
++++ b/lock/lock_deadlock.c
3
+@@ -121,7 +121,7 @@ __lock_detect(env, atype, rejectp)
5 4
  	DB_LOCKTAB *lt;
6 5
  	db_timespec now;
7 6
  	locker_info *idmap;
@@ -10,7 +9,7 @@ diff -urN db-4.7.25.NC/lock/lock_deadlock.c db-4.7.25.NC.new/lock/lock_deadlock.
10 9
  	u_int32_t i, cid, keeper, killid, limit, nalloc, nlockers;
11 10
  	u_int32_t lock_max, txn_max;
12 11
  	int ret, status;
13
-@@ -133,7 +133,8 @@
12
+@@ -133,7 +133,8 @@ __lock_detect(env, atype, rejectp)
14 13
  	if (IS_REP_CLIENT(env))
15 14
  		atype = DB_LOCK_MINWRITE;
16 15
  
@@ -20,7 +19,7 @@ diff -urN db-4.7.25.NC/lock/lock_deadlock.c db-4.7.25.NC.new/lock/lock_deadlock.
20 19
  
21 20
  	lt = env->lk_handle;
22 21
  	if (rejectp != NULL)
23
-@@ -179,11 +180,11 @@
22
+@@ -179,11 +180,11 @@ __lock_detect(env, atype, rejectp)
24 23
  	memcpy(copymap, bitmap, nlockers * sizeof(u_int32_t) * nalloc);
25 24
  
26 25
  	if ((ret = __os_calloc(env, sizeof(u_int32_t), nalloc, &tmpmap)) != 0)
@@ -34,7 +33,7 @@ diff -urN db-4.7.25.NC/lock/lock_deadlock.c db-4.7.25.NC.new/lock/lock_deadlock.
34 33
  		return (ret);
35 34
  
36 35
  	/*
37
-@@ -204,8 +205,7 @@
36
+@@ -204,8 +205,7 @@ __lock_detect(env, atype, rejectp)
38 37
  		txn_max = TXN_MAXIMUM;
39 38
  
40 39
  	killid = BAD_KILLID;
@@ -44,7 +43,7 @@ diff -urN db-4.7.25.NC/lock/lock_deadlock.c db-4.7.25.NC.new/lock/lock_deadlock.
44 43
  		if (rejectp != NULL)
45 44
  			++*rejectp;
46 45
  		killid = (u_int32_t)(*deadp - bitmap) / nalloc;
47
-@@ -342,11 +342,12 @@
46
+@@ -342,11 +342,12 @@ dokill:		if (killid == BAD_KILLID) {
48 47
  			__db_msg(env,
49 48
  			    "Aborting locker %lx", (u_long)idmap[killid].id);
50 49
  	}
@@ -62,7 +61,7 @@ diff -urN db-4.7.25.NC/lock/lock_deadlock.c db-4.7.25.NC.new/lock/lock_deadlock.
62 61
  	__os_free(env, bitmap);
63 62
  	__os_free(env, idmap);
64 63
  
65
-@@ -360,6 +361,17 @@
64
+@@ -360,6 +361,17 @@ err:	if (free_me != NULL)
66 65
  
67 66
  #define	DD_INVALID_ID	((u_int32_t) -1)
68 67
  
@@ -80,7 +79,7 @@ diff -urN db-4.7.25.NC/lock/lock_deadlock.c db-4.7.25.NC.new/lock/lock_deadlock.
80 79
  static int
81 80
  __dd_build(env, atype, bmp, nlockers, allocp, idmap, rejectp)
82 81
  	ENV *env;
83
-@@ -393,6 +405,7 @@
82
+@@ -393,6 +405,7 @@ __dd_build(env, atype, bmp, nlockers, al
84 83
  	 * In particular we do not build the conflict array and our caller
85 84
  	 * needs to expect this.
86 85
  	 */
@@ -88,7 +87,7 @@ diff -urN db-4.7.25.NC/lock/lock_deadlock.c db-4.7.25.NC.new/lock/lock_deadlock.
88 87
  	if (atype == DB_LOCK_EXPIRE) {
89 88
  skip:		LOCK_DD(env, region);
90 89
  		op = SH_TAILQ_FIRST(&region->dd_objs, __db_lockobj);
91
-@@ -430,17 +443,18 @@
90
+@@ -430,17 +443,18 @@ skip:		LOCK_DD(env, region);
92 91
  			OBJECT_UNLOCK(lt, region, indx);
93 92
  		}
94 93
  		UNLOCK_DD(env, region);
@@ -112,7 +111,7 @@ diff -urN db-4.7.25.NC/lock/lock_deadlock.c db-4.7.25.NC.new/lock/lock_deadlock.
112 111
  		*nlockers = 0;
113 112
  		return (0);
114 113
  	}
115
-@@ -448,50 +462,37 @@
114
+@@ -448,50 +462,37 @@ retry:	count = region->stat.st_nlockers;
116 115
  	if (FLD_ISSET(env->dbenv->verbose, DB_VERB_DEADLOCK))
117 116
  		__db_msg(env, "%lu lockers", (u_long)count);
118 117
  
@@ -170,7 +169,7 @@ diff -urN db-4.7.25.NC/lock/lock_deadlock.c db-4.7.25.NC.new/lock/lock_deadlock.
170 169
  			lip->dd_id = id++;
171 170
  			id_array[lip->dd_id].id = lip->id;
172 171
  			switch (atype) {
173
-@@ -510,7 +511,6 @@
172
+@@ -510,7 +511,6 @@ retry:	count = region->stat.st_nlockers;
174 173
  			lip->dd_id = DD_INVALID_ID;
175 174
  
176 175
  	}
@@ -178,7 +177,7 @@ diff -urN db-4.7.25.NC/lock/lock_deadlock.c db-4.7.25.NC.new/lock/lock_deadlock.
178 177
  
179 178
  	/*
180 179
  	 * We only need consider objects that have waiters, so we use
181
-@@ -669,7 +669,6 @@
180
+@@ -669,7 +669,6 @@ again:		memset(bitmap, 0, count * sizeof
182 181
  	 * status after building the bit maps so that we will not detect
183 182
  	 * a blocked transaction without noting that it is already aborting.
184 183
  	 */
@@ -186,7 +185,7 @@ diff -urN db-4.7.25.NC/lock/lock_deadlock.c db-4.7.25.NC.new/lock/lock_deadlock.
186 185
  	for (id = 0; id < count; id++) {
187 186
  		if (!id_array[id].valid)
188 187
  			continue;
189
-@@ -738,6 +737,7 @@
188
+@@ -738,6 +737,7 @@ get_lock:		id_array[id].last_lock = R_OF
190 189
  			id_array[id].in_abort = 1;
191 190
  	}
192 191
  	UNLOCK_LOCKERS(env, region);
@@ -194,7 +193,7 @@ diff -urN db-4.7.25.NC/lock/lock_deadlock.c db-4.7.25.NC.new/lock/lock_deadlock.
194 193
  
195 194
  	/*
196 195
  	 * Now we can release everything except the bitmap matrix that we
197
-@@ -839,6 +839,7 @@
196
+@@ -839,6 +839,7 @@ __dd_abort(env, info, statusp)
198 197
  	ret = 0;
199 198
  
200 199
  	/* We must lock so this locker cannot go away while we abort it. */
@@ -202,7 +201,7 @@ diff -urN db-4.7.25.NC/lock/lock_deadlock.c db-4.7.25.NC.new/lock/lock_deadlock.
202 201
  	LOCK_LOCKERS(env, region);
203 202
  
204 203
  	/*
205
-@@ -895,6 +896,7 @@
204
+@@ -895,6 +896,7 @@ __dd_abort(env, info, statusp)
206 205
  done:	OBJECT_UNLOCK(lt, region, info->last_ndx);
207 206
  err:
208 207
  out:	UNLOCK_LOCKERS(env, region);

+ 118
- 0
libs/db47/patches/040-patch.4.7.25.4.patch Datei anzeigen

@@ -0,0 +1,118 @@
1
+--- a/dbinc/repmgr.h
2
++++ b/dbinc/repmgr.h
3
+@@ -374,6 +374,7 @@ typedef struct {
4
+ #define	SITE_FROM_EID(eid)	(&db_rep->sites[eid])
5
+ #define	EID_FROM_SITE(s)	((int)((s) - (&db_rep->sites[0])))
6
+ #define	IS_VALID_EID(e)		((e) >= 0)
7
++#define	IS_KNOWN_REMOTE_SITE(e)	((e) >= 0 && ((u_int)(e)) < db_rep->site_cnt)
8
+ #define	SELF_EID		INT_MAX
9
+ 
10
+ #define	IS_PEER_POLICY(p) ((p) == DB_REPMGR_ACKS_ALL_PEERS ||		\
11
+--- a/rep/rep_elect.c
12
++++ b/rep/rep_elect.c
13
+@@ -33,7 +33,7 @@ static int __rep_elect_init
14
+ static int __rep_fire_elected __P((ENV *, REP *, u_int32_t));
15
+ static void __rep_elect_master __P((ENV *, REP *));
16
+ static int __rep_tally __P((ENV *, REP *, int, u_int32_t *, u_int32_t, roff_t));
17
+-static int __rep_wait __P((ENV *, db_timeout_t *, int *, int, u_int32_t));
18
++static int __rep_wait __P((ENV *, db_timeout_t *, int, u_int32_t));
19
+ 
20
+ /*
21
+  * __rep_elect --
22
+@@ -55,7 +55,7 @@ __rep_elect(dbenv, given_nsites, nvotes,
23
+ 	ENV *env;
24
+ 	LOG *lp;
25
+ 	REP *rep;
26
+-	int done, eid, elected, full_elect, locked, in_progress, need_req;
27
++	int done, elected, full_elect, locked, in_progress, need_req;
28
+ 	int ret, send_vote, t_ret;
29
+ 	u_int32_t ack, ctlflags, egen, nsites, orig_tally, priority, realpri;
30
+ 	u_int32_t tiebreaker;
31
+@@ -181,8 +181,7 @@ __rep_elect(dbenv, given_nsites, nvotes,
32
+ 			REP_SYSTEM_UNLOCK(env);
33
+ 			(void)__rep_send_message(env, DB_EID_BROADCAST,
34
+ 			    REP_MASTER_REQ, NULL, NULL, 0, 0);
35
+-			ret = __rep_wait(env, &to, &eid,
36
+-			    0, REP_F_EPHASE0);
37
++			ret = __rep_wait(env, &to, 0, REP_F_EPHASE0);
38
+ 			REP_SYSTEM_LOCK(env);
39
+ 			F_CLR(rep, REP_F_EPHASE0);
40
+ 			switch (ret) {
41
+@@ -286,11 +285,11 @@ restart:
42
+ 		REP_SYSTEM_LOCK(env);
43
+ 		goto vote;
44
+ 	}
45
+-	ret = __rep_wait(env, &to, &eid, full_elect, REP_F_EPHASE1);
46
++	ret = __rep_wait(env, &to, full_elect, REP_F_EPHASE1);
47
+ 	switch (ret) {
48
+ 		case 0:
49
+ 			/* Check if election complete or phase complete. */
50
+-			if (eid != DB_EID_INVALID && !IN_ELECTION(rep)) {
51
++			if (!IN_ELECTION(rep)) {
52
+ 				RPRINT(env, DB_VERB_REP_ELECT,
53
+ 				    (env, "Ended election phase 1"));
54
+ 				goto edone;
55
+@@ -398,15 +397,12 @@ phase2:
56
+ 		REP_SYSTEM_LOCK(env);
57
+ 		goto i_won;
58
+ 	}
59
+-	ret = __rep_wait(env, &to, &eid, full_elect, REP_F_EPHASE2);
60
++	ret = __rep_wait(env, &to, full_elect, REP_F_EPHASE2);
61
+ 	RPRINT(env, DB_VERB_REP_ELECT,
62
+ 	    (env, "Ended election phase 2 %d", ret));
63
+ 	switch (ret) {
64
+ 		case 0:
65
+-			if (eid != DB_EID_INVALID)
66
+-				goto edone;
67
+-			ret = DB_REP_UNAVAIL;
68
+-			break;
69
++			goto edone;
70
+ 		case DB_REP_EGENCHG:
71
+ 			if (to > timeout)
72
+ 				to = timeout;
73
+@@ -1050,13 +1046,6 @@ __rep_elect_master(env, rep)
74
+ 	ENV *env;
75
+ 	REP *rep;
76
+ {
77
+-	/*
78
+-	 * We often come through here twice, sometimes even more.  We mustn't
79
+-	 * let the redundant calls affect stats counting.  But rep_elect relies
80
+-	 * on this first part for setting eidp.
81
+-	 */
82
+-	rep->master_id = rep->eid;
83
+-
84
+ 	if (F_ISSET(rep, REP_F_MASTERELECT | REP_F_MASTER)) {
85
+ 		/* We've been through here already; avoid double counting. */
86
+ 		return;
87
+@@ -1093,10 +1082,10 @@ __rep_fire_elected(env, rep, egen)
88
+ 	(timeout > 5000000) ? 500000 : ((timeout >= 10) ? timeout / 10 : 1);
89
+ 
90
+ static int
91
+-__rep_wait(env, timeoutp, eidp, full_elect, flags)
92
++__rep_wait(env, timeoutp, full_elect, flags)
93
+ 	ENV *env;
94
+ 	db_timeout_t *timeoutp;
95
+-	int *eidp, full_elect;
96
++	int full_elect;
97
+ 	u_int32_t flags;
98
+ {
99
+ 	DB_REP *db_rep;
100
+@@ -1174,7 +1163,6 @@ __rep_wait(env, timeoutp, eidp, full_ele
101
+ 			F_CLR(rep, REP_F_EGENUPDATE);
102
+ 			ret = DB_REP_EGENCHG;
103
+ 		} else if (phase_over) {
104
+-			*eidp = rep->master_id;
105
+ 			done = 1;
106
+ 			ret = 0;
107
+ 		}
108
+--- a/repmgr/repmgr_net.c
109
++++ b/repmgr/repmgr_net.c
110
+@@ -100,6 +100,8 @@ __repmgr_send(dbenv, control, rec, lsnp,
111
+ 		    control, rec, &nsites_sent, &npeers_sent)) != 0)
112
+ 			goto out;
113
+ 	} else {
114
++		DB_ASSERT(env, IS_KNOWN_REMOTE_SITE(eid));
115
++
116
+ 		/*
117
+ 		 * If this is a request that can be sent anywhere, then see if
118
+ 		 * we can send it to our peer (to save load on the master), but