Ondřej Kuzník
26f721510a
Improve logging
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
3f5dee0b79
Keep a list of active clients for shutdown purposes.
...
Potentially for timeout detection purposes in the future.
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
e0b8bd5fc9
Free all pending operations on shutdown
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
cf05722b6c
Lookup operations by saved connid.
...
We reset the connection pointer on a destruction attempt, avoid the
spurious asserts.
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
f4afc06920
Tweak connection error logging.
...
Do not log when receiving the last bytes on a connection. Log failed
writes.
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
d020897f5b
Initialise listeners after all workers have been
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
37a474b508
Fix error handling wrt. its callers
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
ee288cfc2d
Fix refcounting for all code paths
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
53015aa4cb
Round robin for backends.
...
Several threads calling backend_select might reset current_backend to a
different place, there are two options to deal with that:
- just let the last rotation win (the current approach)
- detect whether first == current_backend and only replace then
Not sure which one is more useful, going with the simpler.
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
e65cd38787
Round-robin for upstream connections
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
58a880bc7b
Convert backend and upstream management to use CIRCLEQ.
...
This alone doesn't make the server do a round robin.
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
643194e79e
Revert connection/operation mutex order.
...
There was still a race where the connection could be freed as the
operation was still being used.
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
9ebe5acb62
Clean up events properly
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
8eb7f3fbca
Stop the read callback on a dead connection.
...
The connection might be ready to read (close) but if we can't destroy it
yet, we don't want the callback to trigger all the time or process new
data.
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
6899d0123d
Do not bother to write to a dying connection
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
77f2c57132
Reset c_*ber after freeing and check c_pendingber race
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
07b5744c2a
Retain a reference around for handle_responses
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
c5584fd32a
Do not leak responses to abandoned ops
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
7a29fabd09
Destroy the unbind operation when acted upon
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
9d66c26be5
Operation reference counting
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
ea7e40b8e7
Shutdown handling
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
837a6068e0
Rework client_read_cb along the lines of upstream
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
028f28690f
On a failed bind, stop the callback from firing again
...
Not a problem but causes a slew of calls to upstream_bind_cb that will
all fail in the same way.
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
cddc96322d
Do not clear c_pendingber on short write
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
fba4bed6e2
connection reference counting
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
c0d254a4ce
Do not leak BerElements
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
6c8b2acce0
Do not leak addrinfos
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
8f5bae921e
Pending operation tracking and limiting
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
e5fcf17506
Save connection ids on operation for logging purposes
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
54cd3a27f0
Reject operations when binding
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
50f5c4bea7
Report initial bind errors to client
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
2e2c86664a
There might be errors before we save the operation in c_ops
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
b6b3f35aac
Fix proxyauthz handling
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
8b1703d2a7
Implement backend retry timeouts
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
463bcdd2c4
Update backend progress tracking
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
dc5e2538ec
Configuration part for retry timeouts
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
673513a017
Maintain the configured amount of connections per backend
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
798e215ea6
Add connection number config
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
94ee62a4f4
Switch bindkey to use Backend instead of bindconf
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
59291ba4de
Proxyauthz support
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
9309bc9402
Make features global
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
639c5912f5
Client authentication
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
e5f68bcf7c
Option for response handling
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
4ad8ecd45e
Logging improvements
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
f37e7757b1
Response handling, exploit optional bervals
2020-11-17 17:55:45 +00:00
Ondřej Kuzník
2fbc8ca473
Rename backend mutex
2020-11-17 17:42:44 +00:00
Ondřej Kuzník
3d1ea4693e
Authenticate the upstream connection if configured
2020-11-17 17:42:44 +00:00
Ondřej Kuzník
5bdb4e1570
Update maximum number or parameters for backend
2020-11-17 17:42:44 +00:00
Ondřej Kuzník
fd5b9cdb91
This is a proxy now
2020-11-17 17:42:44 +00:00
Ondřej Kuzník
93fe1d2bab
Operation parsing
2020-11-17 17:42:44 +00:00
Ondřej Kuzník
b49932d637
Connection write support
2020-11-17 17:42:43 +00:00
Ondřej Kuzník
79f7e79f15
Set up connections in the worker threads
2020-11-17 17:15:40 +00:00
Ondřej Kuzník
bf66b48fe3
Upstream connection setup
2020-11-17 17:15:40 +00:00
Ondřej Kuzník
1a45249054
Update connection init
2020-11-17 17:15:40 +00:00
Ondřej Kuzník
8e0a6119fa
Startup adjustment
2020-11-17 17:15:40 +00:00
Ondřej Kuzník
c596b797ed
Backend configuration
2020-11-17 17:15:40 +00:00
Ondřej Kuzník
46ddb4039c
lloadd ahoy
2020-11-17 17:15:40 +00:00
Howard Chu
a87ae275e1
ITS#9394 syncprov: ignore duplicate sessionlog entries
2020-11-17 00:31:56 +00:00
Quanah Gibson-Mount
6492012e00
Remove various unused variables
2020-11-12 18:05:59 +00:00
Howard Chu
9eb948529b
ITS#9391 remove asserts in UUIDNormalize()
2020-11-11 18:25:31 +00:00
Ondřej Kuzník
ee49c83976
Cleanup use of *alloc() in daemon.c
2020-11-09 16:57:21 +00:00
Ondřej Kuzník
727ec3ae14
ITS#9386 State change issues are still ignored, but at least log them
2020-11-09 11:51:20 +00:00
Ondřej Kuzník
123001c89d
ITS#9386 Address compiler warnings
2020-11-09 11:50:37 +00:00
Howard Chu
6b0fc9e034
ITS#9121 fix filtered memberOf
...
Broken in 2c0499ae4e
adding nesting
2020-11-03 01:18:32 +00:00
Howard Chu
c0eeb2b9b8
ITS#9384 remove assert in obsolete csnNormalize23()
2020-11-02 16:01:14 +00:00
Howard Chu
265d362f27
ITS#9383 remove assert in certificateListValidate
2020-11-02 13:12:10 +00:00
Howard Chu
87158469eb
ITS#9121 fix dynlist_filter_dup for substring filter
2020-10-30 23:30:28 +00:00
Quanah Gibson-Mount
2f0883d161
ITS#9380 - Fix return type for connection_write_resume
2020-10-29 19:55:37 +00:00
Howard Chu
db46f88853
ITS#9379 reject listener URLs with non-empty DNs
2020-10-28 16:50:23 +00:00
Ondřej Kuzník
98a0029dae
ITS#9366 Check ldap_install_tls return and remove connection if failed
2020-10-23 20:38:21 +00:00
Howard Chu
6abfd60078
ITS#9370 revert previous commit, alternate fix
...
Just skip normalization if there's no equality rule. We accept
DNs without equality rules already.
2020-10-19 14:14:54 +01:00
Howard Chu
a08a2db406
ITS#9370 check for equality rule on old_rdn
...
We should probably just check in dnNormalize instead, and catch
this everywhere DNs are received. It might make us reject some
DNs that are already in use, though (e.g. received from other
directory servers that don't do schema checking).
2020-10-19 14:03:41 +01:00
Howard Chu
c1912fb7af
ITS#9121 don't process nested memberOf if memberOf wasn't requested
2020-10-13 22:11:44 +01:00
Howard Chu
fb587d3d58
ITS#9361 prevent CSN from being generated for purge deletes
2020-10-02 13:25:52 +01:00
Howard Chu
56860fc405
ITS#9342 delta-syncL ignore add of already existing entry
...
if the entryCSN is older. Previous patch breaks if writes are
received out of order, e.g. during a refresh.
2020-10-01 14:27:24 +01:00
Ondřej Kuzník
efc23cddc3
ITS#9295 Do not replace 'op'
2020-09-30 18:55:34 +00:00
Ondřej Kuzník
20024d5ba8
ITS#9359 Do not create an empty add
2020-09-30 19:25:56 +01:00
Howard Chu
ed949bf287
ITS#9342 delta-sync: ignore add if entryCSN is too old
...
This check is only needed for ops received without a CSN in their cookie.
This only occurs when the ops completed out of order on the provider.
2020-09-30 15:45:04 +00:00
Howard Chu
80a545b5ed
Partially Revert "ITS#8486 use kbtree for sessionlog"
...
This mostly reverts commit 1915cb968a
.
Too many concurrency issues. Retains the improvement to
syncprov_sessionlog_cmp
2020-09-30 15:11:31 +00:00
Howard Chu
2bbb51e20b
ITS#9358 Fix reqStart normalizer
...
Don't truncate trailing zeroes in reqStart/reqEnd timestamps
2020-09-29 09:43:37 +01:00
Ondřej Kuzník
67d005ee65
ITS#9348 Stop using plain strerror()
2020-09-25 12:47:46 +01:00
Quanah Gibson-Mount
f3e86d3d93
ITS#8636 - Fix DESC for deltaCRL attribute
2020-09-25 04:29:59 +00:00
Quanah Gibson-Mount
fe3636df9d
ITS#8341 - Add matching rule to the namingContexts attr
2020-09-25 02:05:55 +00:00
Howard Chu
1915cb968a
ITS#8486 use kbtree for sessionlog
...
Saves about 20% CPU time and RAM
2020-09-25 00:07:50 +00:00
Ondřej Kuzník
98d5c5c6ce
ITS#8486 Protect tavl_* calls in play_sessionlog
2020-09-25 00:07:50 +00:00
Howard Chu
8f8774c0b1
ITS#8486 Minor play_sessionlog cleanup
...
Fix logmsg uuidstr.
Shortcut finding start of playback.
Allow dup CSNs in log, but with different UUIDs. All
non-present deletes in a refresh use the same CSN.
2020-09-25 00:07:50 +00:00
Ondřej Kuzník
d2036cec90
ITS#8486 Switch sessionlog to use TAVL
2020-09-25 00:07:50 +00:00
Ondřej Kuzník
3f5293e145
ITS#5422 Save errno before passing it to Debug()
2020-09-24 23:34:36 +00:00
Howard Chu
c3131eb5a3
ITS#9348 replace all uses of STRERROR with AC_STRERROR_R
...
Avoid using sys_errlist unless there's no other choice
2020-09-24 23:34:36 +00:00
Ondřej Kuzník
1b8e6b944b
ITS#9355 Propagate errors from overlay_entry_get_ov
2020-09-23 11:10:29 +01:00
Howard Chu
62ecd38bc4
ITS#8102 syncrepl: only use trylock on the cn=config DB
2020-09-22 21:27:15 +01:00
Quanah Gibson-Mount
a3f186880c
ITS#9351 - Always build back-monitor as a static backend
2020-09-21 16:52:33 +00:00
Howard Chu
dd82fa5393
ITS#9353 fix monitor_back_register_database for empty suffix DB
...
Use the correct database entry instead of the frontendDB entry
2020-09-20 16:29:38 +01:00
Quanah Gibson-Mount
bc021bb244
ITS#6749 - Change configure monitor warning to DEBUG CONFIG instead of DEBUG ANY
2020-09-18 14:56:43 +00:00
Howard Chu
331e587754
ITS#9352 syncrepl: fix syncrepl_op_modify on entry with no entryCSN
2020-09-17 20:18:20 +01:00
Gabriel Buades
984ecd113a
ITS#9349 slapd-mdb: optimize index delete
...
Performance improvement for indexed attributes removal
2020-09-17 18:21:53 +01:00
Howard Chu
2b512ea79c
ITS#9339 Fix syncrepl_monitor_init for dynamic monitor backend
...
Calling from backend.c only works if back-monitor is a static backend
2020-09-17 15:22:01 +01:00
Howard Chu
3e181b8453
Silence stupid warnings
2020-09-16 23:27:45 +01:00
Quanah Gibson-Mount
947b8ed9d6
Fix code indentation for recent changes
2020-09-16 21:13:28 +00:00
Howard Chu
d63287e2f4
ITS#9345 fix for cmdline cookie
...
Previous commit could cause cmdline cookie to be ignored
2020-09-15 15:00:57 +00:00