You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "yashmayya (via GitHub)" <gi...@apache.org> on 2025/05/07 13:12:22 UTC

[PR] Don't use static variables for per-table metadata in ReplicaGroupSegmentAssignmentStrategy [pinot]

yashmayya opened a new pull request, #15734:
URL: https://github.com/apache/pinot/pull/15734

   - It's unclear why these were static variables in the first place, and it seems like this has gone unnoticed for so long only because all usages seem to be creating a new instance of the `SegmentAssignmentStrategy` right before calling `assignSegment` or `reassignSegments`.
   - That isn't bulletproof though and we could run into all kinds of weird issues if multiple tables using replica groups require segments to be assigned or rebalanced concurrently.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Don't use static variables for per-table metadata in ReplicaGroupSegmentAssignmentStrategy [pinot]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #15734:
URL: https://github.com/apache/pinot/pull/15734#discussion_r2077600049


##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/assignment/segment/strategy/ReplicaGroupSegmentAssignmentStrategy.java:
##########
@@ -40,9 +40,9 @@
 class ReplicaGroupSegmentAssignmentStrategy implements SegmentAssignmentStrategy {
   private static final Logger LOGGER = LoggerFactory.getLogger(ReplicaGroupSegmentAssignmentStrategy.class);
 
-  private static HelixManager _helixManager;
-  private static String _tableName;
-  private static String _partitionColumn;
+  private HelixManager _helixManager;

Review Comment:
   Changing the metadata variable from a static to an instance variable resolves potential concurrency issues when multiple tables are processed concurrently. Ensure that all other usages of these fields are updated accordingly to maintain object encapsulation.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Don't use static variables for per-table metadata in ReplicaGroupSegmentAssignmentStrategy [pinot]

Posted by "yashmayya (via GitHub)" <gi...@apache.org>.
yashmayya merged PR #15734:
URL: https://github.com/apache/pinot/pull/15734


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org