Commit Graph

76 Commits

Author SHA1 Message Date
Ondřej Kuzník
1ca559668f ITS#9599 Add latency tracking 2021-08-13 10:57:14 +01:00
Ondřej Kuzník
ab90bfd95c ITS#9599 Implement tiered load balancing 2021-08-13 10:57:14 +01:00
Ondřej Kuzník
ddc9430727 ITS#9598 Per OID restrictions 2021-08-13 10:57:14 +01:00
Ondřej Kuzník
0190f18b4c ITS#9598 Introduce backend-restricted selection 2021-08-13 10:57:14 +01:00
Ondřej Kuzník
71de64fac4 ITS#9624 Make sure we reset only for Binds 2021-08-04 15:30:36 +00:00
Ondřej Kuzník
1cb65102ce ITS#8747 Keep an explicit backend pointer 2021-05-10 18:49:13 +00:00
Ondřej Kuzník
e36d1e31c5 ITS#9001 manual changes 2021-03-30 15:46:40 +01:00
Ondřej Kuzník
5fa0a651f5 revert: libevent 2.0 support 2021-02-24 18:11:09 +00:00
Quanah Gibson-Mount
efaf9a4a17 Happy New Year! 2021-01-11 19:25:53 +00:00
Ondřej Kuzník
dfbed44b3e Do not accept requests with msgid == 0
It is used internally to identify pinned operations and should not be
encountered over the wire.
2020-11-17 17:58:15 +00:00
Ondřej Kuzník
68b163fca9 Introduce mutex checks
Switched off unless thread debugging is on, but still useful for static
analysis.
2020-11-17 17:58:15 +00:00
Ondřej Kuzník
62a806b243 Thread error checking 2020-11-17 17:58:15 +00:00
Ondřej Kuzník
58d66a3946 Fix race between unlinking a client and processing incoming data 2020-11-17 17:58:15 +00:00
Ondřej Kuzník
dc1961cb15 Epoch based memory reclamation
Similar to the algorithm presented in
https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-579.pdf

Not completely lock-free at the moment. Also the problems with epoch
based memory reclamation are still present - a thread actively observing
an epoch getting stuck will prevent LloadConnections and LloadOperations
being freed, potentially running out of memory.
2020-11-17 17:58:15 +00:00
Ondřej Kuzník
aab6af1c4e Switch to LDAP_OTHER when handling a lost upstream.
LDAP_UNAVAILABLE signals "the server is shutting down or a subsystem
necessary to complete the operation is offline", so intelligent clients
tend to infer the connection will not be usable any more, which is not
the case here.
2020-11-17 17:58:15 +00:00
Ondřej Kuzník
b4f43ed8e1 Refactor backend reset
Reuse the connection walking facility in timeout management.
2020-11-17 17:58:15 +00:00
Ondřej Kuzník
00806dd32a libevent 2.0 support 2020-11-17 17:58:15 +00:00
Ondřej Kuzník
db939eeb86 Protect operation when abandoning 2020-11-17 17:58:15 +00:00
Ondřej Kuzník
1ea5ee1f01 Do not unlock upstream without referencing its dying ops 2020-11-17 17:58:15 +00:00
Ondřej Kuzník
ca646cd02d Fix operation counts
Trying to abandon an operation does not automatically make it completed,
it might have failed already but we're just racing to reach the client
to record that.
2020-11-17 17:58:14 +00:00
Ondřej Kuzník
bea9bfb33d Move op counting to operation_init 2020-11-17 17:58:14 +00:00
Ondřej Kuzník
9bd90a741c Fix a race on bind response processing.
During response processing, an upstream connection could be marked ready
after a different bind had already been allocated to it, thus allowing
two binds to be in progress on the same connection.
2020-11-17 17:58:14 +00:00
Nadezhda Ivanova
2d33032504 Lload cn=monitor initial implementation 2020-11-17 17:58:14 +00:00
Ondřej Kuzník
cbc0ec04c0 Fix pinned operation forwarding 2020-11-17 17:58:14 +00:00
Ondřej Kuzník
2ba833680f Operation abandon related fixes 2020-11-17 17:58:14 +00:00
Ondřej Kuzník
5c1245de06 Manage c_sasl_bind_mech on upstream 2020-11-17 17:58:14 +00:00
Ondřej Kuzník
003a35c62f SASL bind support
Introduces pinned operations. When SASL bind finishes, we might still
have to maintain a link between the client an an upstream for future
bind operations if we got a SASL Bind in Progress result code. We zero
out the msgids and remember a server-unique identifer on the client and
the relevant operation that lets us retrieve that link again. This
operation is reclaimed just like anything else when connections drop.

Hopefully, this should work for LDAP TXN and VC Exop support with SASL
later as well since it allows for many-to-many links to exist.
2020-11-17 17:58:14 +00:00
Ondřej Kuzník
1fd7249f8e RFC4511 says Binds do not abandon, send a "reset" bind instead 2020-11-17 17:58:14 +00:00
Nadezhda Ivanova
8bc7650a7c Clean ups and renames to coexist with slapd 2020-11-17 17:58:14 +00:00
Ondřej Kuzník
aecc62c08e Introduce operation timeout machinery 2020-11-17 17:58:14 +00:00
Ondřej Kuzník
8ba44630ef Factor out abandon message preparation 2020-11-17 17:58:14 +00:00
Ondřej Kuzník
1790018488 Record operation activity times 2020-11-17 17:58:14 +00:00
Ondřej Kuzník
abab7e46ad Move client related functions to client.c 2020-11-17 17:58:14 +00:00
Ondřej Kuzník
b801ca17cb Rename macros and symbols to lloadd 2020-11-17 17:58:14 +00:00
Ondřej Kuzník
7cd531c069 Improve spec conformance, logging 2020-11-17 17:58:14 +00:00
Ondřej Kuzník
0b3531066d Refactor operation_send_reject 2020-11-17 17:55:46 +00:00
Ondřej Kuzník
8d93e0baa0 Unify connection locking and I/O 2020-11-17 17:55:46 +00:00
Ondřej Kuzník
5fcef01d62 Switch from a global mutex 2020-11-17 17:55:46 +00:00
Ondřej Kuzník
96b7619afc Do not unlock client unless we are destroying it 2020-11-17 17:55:46 +00:00
Ondřej Kuzník
362d550328 Do not crash when closing both client and upstream 2020-11-17 17:55:46 +00:00
Ondřej Kuzník
532fc1bf98 Shorten time operation_mutex is locked 2020-11-17 17:55:46 +00:00
Ondřej Kuzník
e03c9e6fb4 Stop processing if we freed the client 2020-11-17 17:55:46 +00:00
Ondřej Kuzník
f7cf34e69c Reset connection state on abandon 2020-11-17 17:55:46 +00:00
Ondřej Kuzník
6140cdf6f8 Handle a client connection disconnected from op 2020-11-17 17:55:46 +00:00
Ondřej Kuzník
cda8411c48 Close up the race 2020-11-17 17:55:46 +00:00
Ondřej Kuzník
31074213f7 TENTATIVE: communicate more for op destroy race 2020-11-17 17:55:46 +00:00
Ondřej Kuzník
16010e5e16 More logging improvements 2020-11-17 17:55:46 +00:00
Ondřej Kuzník
30e538e836 Realign logging levels.
Stats now logs all operations, stats2 additionally intermediate messages
(search entries).
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
33a993553d Unblock the client when we can't find an upstream
If we can't find an upstream, we keep the client around, so it needs to
be unblocked.
2020-11-17 17:55:46 +00:00
Ondřej Kuzník
95df8a1ec8 Adjust backend operation counting 2020-11-17 17:55:46 +00:00