[Let's try that again. Hotmail/Chrome managed to screw up the formatting before]
Does anyone have an example of using the pcache overlay with back-sql? Here's the relevant section of my slapd.config: database sql suffix "......" rootdn "......." rootpw ........ dbname MySQL dbuser ......... subtree_cond "ldap_entries.dn like CONCAT('%',?)" insentry_stmt "INSERT INTO ldap_entries (dn,oc_map_id,parent,keyval) VALUES (?,?,?,?)" has_ldapinfo_dn_ru no baseobjectupper_func UPPER autocommit yes
pcache bdb 10000 1 50 100 pcacheAttrset 0 * + pcacheTemplate (objectClass=) 0 60 ... pcache-directory /var/tmp/cache pcache-cachesize 100
What I'm unclear about is how to configure the private bdb database used for the cache.
When use this config, slapd starts up ok, but crashes with a SEGV when (I assume) it tries to cache a result: (I am running slapd built from the latest code in HEAD from git)
slap_queue_csn: queing 0xb7a52efa 20110629132038.554471Z#000000#000#000000 Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0xb7a55b90 (LWP 26226)] 0x080f3844 in slap_queue_csn (op=0xb7a53378, csn=0xb7a52f60) at ctxcsn.c:199 199 LDAP_TAILQ_INSERT_TAIL( be->be_pending_csn_list, (gdb) where #0 0x080f3844 in slap_queue_csn (op=0xb7a53378, csn=0xb7a52f60) at ctxcsn.c:199 #1 0x080f38e0 in slap_get_csn (op=0xb7a53378, csn=0xb7a52f60, manage_ctxcsn=1) at ctxcsn.c:214 #2 0x08079f33 in slap_add_opattrs (op=0xb7a53378, text=0xb7a53214, textbuf=0xb7a53074 "", textlen=256, manage_ctxcsn=1) at add.c:609 #3 0x0814187b in bdb_add (op=0xb7a53378, rs=0xb7a53200) at add.c:107 #4 0x081a144e in merge_entry (op=0xb7a53378, e=0x9f56e4c, dup=0, query_uuid=0xa040848) at pcache.c:865 #5 0x081a4d1c in cache_entries (op=0x9fdbfc8, query_uuid=0xa040848) at pcache.c:2325 #6 0x081a5244 in pcache_op_cleanup (op=0x9fdbfc8, rs=0xb7a550e4) at pcache.c:2430 #7 0x08084697 in slap_cleanup_play (op=0x9fdbfc8, rs=0xb7a550e4) at result.c:539 #8 0x08084dd3 in send_ldap_response (op=0x9fdbfc8, rs=0xb7a550e4) at result.c:724 #9 0x0808554e in slap_send_ldap_result (op=0x9fdbfc8, rs=0xb7a550e4) at result.c:851 #10 0x0813e4a3 in backsql_search (op=0x9fdbfc8, rs=0xb7a550e4) at search.c:2493 #11 0x0807402e in fe_op_search (op=0x9fdbfc8, rs=0xb7a550e4) at search.c:402 #12 0x080f1aaa in overlay_op_walk (op=0x9fdbfc8, rs=0xb7a550e4, which=op_search, oi=0x9f3dc80, on=0x0) at backover.c:671 #13 0x080f1c5f in over_op_func (op=0x9fdbfc8, rs=0xb7a550e4, which=op_search) at backover.c:723 #14 0x080f1d0e in over_op_search (op=0x9fdbfc8, rs=0xb7a550e4) at backover.c:750 #15 0x0807397d in do_search (op=0x9fdbfc8, rs=0xb7a550e4) at search.c:247 #16 0x08070704 in connection_operation (ctx=0xb7a551d0, arg_v=0x9fdbfc8) at connection.c:1138 #17 0x08070c44 in connection_read_thread (ctx=0xb7a551d0, argv=0xd) at connection.c:1274 #18 0x081e04a5 in ldap_int_thread_pool_wrapper (xpool=0x9f11f78) at tpool.c:685 #19 0x004be5ab in start_thread () from /lib/libpthread.so.0 #20 0x003b2cfe in clone () from /lib/libc.so.6
It crashes because be->be_pending_csn_list is zero, presumably because backend_startup_one() has not been called for this backend. This leads me to believe that I need something in slapd.conf to get the private bdb database initialised, but what?
Chris
Does anyone have an example of using the pcache overlay with back-sql? Here's the relevant section of my slapd.config:
I've found the problem I think, I had the "overlay pcache" in the global section, rather than in the "database sql" section.At least it's not crashing now, I'm still trying to convince myself that repeated requests are being served from the cache.
Chris
Does anyone have an example of using the pcache overlay with back-sql? Here's the relevant section of my slapd.config:
I've found the problem I think, I had the "overlay pcache" in the global section, rather than in the "database sql" section.At least it's not crashing now, I'm still trying to convince myself that repeated requests are being served from the cache.
did you read (and understand) slapo-pcache(5)? only queries matching configured templates (filter + requested attributes) are cached. Use "pcache" logging subsystem to track whether caching occurs.
p.
Does anyone have an example of using the pcache overlay with back-sql? Here's the relevant section of my slapd.config:
I've found the problem I think, I had the "overlay pcache" in the global section, rather than in the "database sql" section.At least it's not crashing now, I'm still trying to convince myself that repeated requests are being served from the cache.
did you read (and understand) slapo-pcache(5)? only queries matching configured templates (filter + requested attributes) are cached. Use "pcache" logging subsystem to track whether caching occurs.
p.
Yes, I've read that manual page and configured templates. I've also got the monitoring backend working, and I can see that caching is happening. Can you point me to documentation about the pcache logging subsystem? Chris
Does anyone have an example of using the pcache overlay with
back-sql?
Here's the relevant section of my slapd.config:
I've found the problem I think, I had the "overlay pcache" in the
global
section, rather than in the "database sql" section.At least it's not crashing now, I'm still trying to convince myself that repeated
requests
are being served from the cache.
did you read (and understand) slapo-pcache(5)? only queries matching configured templates (filter + requested attributes) are cached. Use "pcache" logging subsystem to track whether caching occurs.
p.
Yes, I've read that manual page and configured templates. I've also got the monitoring backend working, and I can see that caching is happening. Can you point me to documentation about the pcache logging subsystem?
slapd -d pcache
Indeed, I can't find any mention of it in obvious places (slapo-pcache(5), admin guide under pcache overlay, loglevel directive in slapd.conf(5) or slapd-config(5)). I suggest you file a request for documentation update.
p.
Can you point me to documentation about the pcache logging subsystem?
slapd -d pcache
Indeed, I can't find any mention of it in obvious places (slapo-pcache(5), admin guide under pcache overlay, loglevel directive in slapd.conf(5) or slapd-config(5)). I suggest you file a request for documentation update.
p.
I tried that and slapd didn't recognize it. Looking at the code (which I took from HEAD yesterday), I can't see any reference to a pcache logging level (servers/slapd/bconfig.c):
static int loglevel_init( void ) { slap_verbmasks lo[] = { { BER_BVC("Any"), (slap_mask_t) LDAP_DEBUG_ANY }, { BER_BVC("Trace"), LDAP_DEBUG_TRACE }, { BER_BVC("Packets"), LDAP_DEBUG_PACKETS }, { BER_BVC("Args"), LDAP_DEBUG_ARGS }, { BER_BVC("Conns"), LDAP_DEBUG_CONNS }, { BER_BVC("BER"), LDAP_DEBUG_BER }, { BER_BVC("Filter"), LDAP_DEBUG_FILTER }, { BER_BVC("Config"), LDAP_DEBUG_CONFIG }, { BER_BVC("ACL"), LDAP_DEBUG_ACL }, { BER_BVC("Stats"), LDAP_DEBUG_STATS }, { BER_BVC("Stats2"), LDAP_DEBUG_STATS2 }, { BER_BVC("Shell"), LDAP_DEBUG_SHELL }, { BER_BVC("Parse"), LDAP_DEBUG_PARSE }, #if 0 /* no longer used (nor supported) */ { BER_BVC("Cache"), LDAP_DEBUG_CACHE }, { BER_BVC("Index"), LDAP_DEBUG_INDEX }, #endif { BER_BVC("Sync"), LDAP_DEBUG_SYNC }, { BER_BVC("None"), LDAP_DEBUG_NONE }, { BER_BVNULL, 0 } };
return slap_verbmasks_init( &loglevel_ops, lo ); }
I can see lots of calls to Debug() in pcache.c, and with logging level set to -1 I can see these messages in the log file, so I'm happy that caching is working, but it looks like the pcache debug level is not fully implemented, or has been lost in a merge somewhere.
Chris
Can you point me to documentation about the pcache logging subsystem?
slapd -d pcache
Indeed, I can't find any mention of it in obvious places (slapo-pcache(5), admin guide under pcache overlay, loglevel directive in slapd.conf(5) or slapd-config(5)). I suggest you file a request for documentation update.
p.
I tried that and slapd didn't recognize it. Looking at the code (which I took from HEAD yesterday), I can't see any reference to a pcache logging level (servers/slapd/bconfig.c):
It is registered by the overlay itself as soon as it is initialized.
p.
Can you point me to documentation about the pcache logging subsystem?
slapd -d pcache
Indeed, I can't find any mention of it in obvious places (slapo-pcache(5), admin guide under pcache overlay, loglevel directive in slapd.conf(5) or slapd-config(5)). I suggest you file a request for documentation update.
p.
I tried that and slapd didn't recognize it. Looking at the code (which I took from HEAD yesterday), I can't see any reference to a pcache logging level (servers/slapd/bconfig.c):
It is registered by the overlay itself as soon as it is initialized.
p.
ok, thanks, that makes sense. Anyway, I'm happy that stuff is being cached. I have found a bug though, when using pcache and sssvlv together, which I'll raise in ITS. Chris
openldap-technical@openldap.org