Conversation
robshakir
commented
Jan 31, 2022
* (M) rib/rib.go
* (M) rib/rib_test.go
- Ensure that the DeleteXXX functions handle locking correctly, such
that they always hold a lock when accessing the map.
- Add lockless deleteXXX functions that can be called internally
when the client has a lock on the entire RIB. This is needed in
order to ensure that inter-client locks can be held (e.g.,
when removing all entries with Flush).
* (M) server/server.go
* (M) server/server_test.go
- Add support for Flush removing entries from the server RIB.
- Add test coverage for Flush.
sthesayi
left a comment
There was a problem hiding this comment.
I would admit that I haven't done a deep review of the use of locks. If you want a deep review please let me know.
|
Thanks @sthesayi -- I think this wasn't so much a bug in the locking, just an assumption that wasn't quite right. Essentially, To that end, I refactored I don't think there's anything different about the lock design here that sounds too concerning -- but I'm more than happy to talk it through. This RIB-level lock is the simplest implementation - and seems to be working fairly well thus far, but I'm sure at some point there might be a performance requirement to think through it more. Let me know if you're concerned about anything above, and we can review it further/redesign. |
|
This explanation is great and I gathered the same during the review. I agree that the RIB level lock is the simplest and safe one to think of and this can be revisited when a performance issue shows up. I would presume a Flush is a relatively rare operation, such as executing during startup, etc edge cases. In all other normal cases, individual deletes are more likely. LGTM |
* (M) client/client.go
* (M) client/client_test.go
- Add support for the Flush RPC to be issued by a client.
* (M) server/server.go
- Add support for the FakeServer injecting an election ID to allow
for testing of SINGLE_PRIMARY cases outside of setting up the
server.
* (M) client/client.go
- Modify return value to allow the client to receive the gRPC status
error.
* (M) compliance/compliance.go
* (A) compliance/flush.go
- Add new test cases for the Flush RPC.
* (M) fluent/fluent.go
- Add Flush fluent API.