Page MenuHomePhabricator

[services] Tunnelbroker - Removing processed messages
ClosedPublic

Authored by max on Nov 9 2022, 6:51 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Oct 31, 2:44 PM
Unknown Object (File)
Oct 25 2024, 10:09 PM
Unknown Object (File)
Oct 17 2024, 10:02 PM
Unknown Object (File)
Oct 2 2024, 7:27 PM
Unknown Object (File)
Sep 28 2024, 10:51 PM
Unknown Object (File)
Sep 28 2024, 8:31 PM
Unknown Object (File)
Sep 26 2024, 9:42 PM
Unknown Object (File)
Sep 26 2024, 9:42 PM

Details

Summary

This diff adds removing of processed messages by the client from the database and handling of the incoming processedMessages gRPC message.
When the Tunnelbroker sends messages to the client by MessagesToDeliver (in D5540, D5580) we are expecting messages IDs back from the client as ProcessedMessages when they are successfully processed. After receiving the messages IDs the Tunnelbroker will remove messages from the database. Using this mechanism we are sure that the messages were successfully processed by the client before removing them.

Linear task: ENG-2060

Test Plan
  1. Insert a message into the messages table with the corresponding deviceID in the toDeviceID field.
  2. Connect by the gRPC client to the bidirectional stream with the sessionID corresponding to the deviceID in metadata.
  3. The message from the database would be delivered to the client as the MessagesToDeliver.
  4. Get the messageID identifier from the delivered message.
  5. Send back to the stream a processedMessages message with the message identifier.
  6. The expected result is that the message with the corresponding messageID will be removed from the database in messages table.

Diff Detail

Repository
rCOMM Comm
Branch
add-grpc-messages-removing-processed
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

max held this revision as a draft.
max edited the test plan for this revision. (Show Details)
max added reviewers: varun, marcin. max added 1 blocking reviewer(s): jon.
max published this revision for review.Nov 9 2022, 7:26 AM
max edited the summary of this revision. (Show Details)
max edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Nov 9 2022, 11:05 AM
This revision now requires review to proceed.Nov 10 2022, 2:17 AM

Change to pass the pointer of the Vector to c++ function.

tomek added inline comments.
services/tunnelbroker/src/server/mod.rs
290 ↗(On Diff #18309)

This is slightly confusing: this parameter messagesIDs is a vector of ids, but we seem to pass a single id processed_messages.message_id to it. Should we change some names to make it consistent?

This revision is now accepted and ready to land.Nov 17 2022, 3:24 AM
max added inline comments.
services/tunnelbroker/src/server/mod.rs
290 ↗(On Diff #18309)

This is slightly confusing: this parameter messagesIDs is a vector of ids, but we seem to pass a single id processed_messages.message_id to it. Should we change some names to make it consistent?

That came from the gRPC proto file field name. We should change it to be plural. I've created a task for this. Thanks!

max marked an inline comment as done.

Rebasing on parents and master changes.