Page MenuHomePhabricator

[services] Tunnelbroker - Switching to use composite key in a messages table in Terraform
ClosedPublic

Authored by max on Jul 7 2022, 6:37 AM.
Tags
None
Referenced Files
F3386422: D4473.id14841.diff
Fri, Nov 29, 4:38 AM
F3386399: D4473.id14264.diff
Fri, Nov 29, 4:31 AM
F3385869: D4473.diff
Fri, Nov 29, 2:45 AM
F3384550: D4473.id.diff
Thu, Nov 28, 9:34 PM
Unknown Object (File)
Sun, Nov 17, 4:02 PM
Unknown Object (File)
Tue, Nov 5, 10:04 PM
Unknown Object (File)
Tue, Nov 5, 9:52 PM
Unknown Object (File)
Tue, Nov 5, 7:38 PM

Details

Summary

To avoid possible message UUID collision and speedup batch messages deletion we should switch to using the composite key for the tunnelbroker-messages table which will consist of messagesID as a Sort Key and toDeviceID as a Partition key.

This diff is a part of the stack and introduces changes for Terraform.

Linear task: ENG-1362

Test Plan

These changes should be tested at the D4475 diff. The current messageItem related tests at services/tunnelbroker/test/DatabaseManagerTest.cpp should not fail including:

  • PutAndFoundMessageItemsStaticDataIsSame
  • PutAndFoundMessageItemsGeneratedDataIsSame
  • PutAndFoundByReceiverMessageItemsDataIsSame

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

max held this revision as a draft.
max retitled this revision from [services] Tunnelbroker - Switching to use composite key in a messages table inTerraform to [services] Tunnelbroker - Switching to use composite key in a messages table in Terraform.Jul 7 2022, 6:48 AM
max added reviewers: karol, tomek.
max published this revision for review.Jul 7 2022, 7:06 AM
tomek added 1 blocking reviewer(s): karol.

Shouldn't we also modify the entity files? I'd put the fields in this file (especially in the constructor) in the correct order which would be:

  • partition key
  • sort key
  • the rest of the fields

So, for the messages this would be:

  • toDeviceID
  • messageID
  • fromDeviceID
  • payload
  • ...

What do you think? Sorry for requesting changes but I wanted to push it to your queue.

This revision now requires changes to proceed.Jul 11 2022, 3:07 AM
In D4473#127995, @karol-bisztyga wrote:

Shouldn't we also modify the entity files? I'd put the fields in this file (especially in the constructor) in the correct order which would be:

  • partition key
  • sort key
  • the rest of the fields

So, for the messages this would be:

  • toDeviceID
  • messageID
  • fromDeviceID
  • payload
  • ...

What do you think? Sorry for requesting changes but I wanted to push it to your queue.

I think this is a good idea. I created a follow-up for this as ENG-1384.

This revision is now accepted and ready to land.Jul 19 2022, 2:17 AM