temporal icon indicating copy to clipboard operation
temporal copied to clipboard

Refactor tqname package

Open ShahabT opened this issue 1 year ago • 1 comments

What changed?

  • Replaced package tqname with tqid containing the following types
    • TaskQueue struct including namespace ID and user-given TQ name
    • Partition interface which can be either a NormalPartition or a StickyPartition
  • Replaced taskQueueID with DBTaskQueue
  • Delete stickyInfo
  • Replaced all usage of tqname and taskQueueID with new types depending on the exact entity that we are dealing with (TQ vs Sticky TQ partition vs normal TQ partition vs DB queue)
  • Created userDataManager responsible for fetching/loading and updating user data. Extracted all the related logic from taskQueueDB and taskQueuePartitionManger into userDataManager.
  • Renamed taskQueueManager to dbQueueManager
    • moved forwarder up inside partition manager.

Why?

This is an overdue refactoring, we need proper distinction between all different entities mentioned above that are called "task queue".

How did you test it?

Mainly existing unit tests. Added few new ones where needed.

Potential risks

No known behavioral change is introduced, but need to keep an eye on this to make sure the refactoring has not change anything unintentionally.

Is hotfix candidate?

No.

ShahabT avatar Jan 22 '24 04:01 ShahabT

There's a bunch of unrelated stuff on this pr so it'll take a while, or should be split. First just high level comments:

  • Replaced package tqname with taskqueue containing the following types

The name was chosen deliberately since the package does only name mangling. It should stay that way, and possibly additional functionality should be in another package (I'll have to see the details when I get into the code).

Also, we shouldn't name a package taskqueue.. that's already way overloaded.

  • Created userDataManager responsible for fetching/loading and updating user data. Extracted all the related logic from taskQueueDB and taskQueuePartitionManger into userDataManager.

This at least should be in a separate PR.

dnr avatar Jan 23 '24 22:01 dnr