Skip to content

Conversation

ibilley7
Copy link
Contributor

@ibilley7 ibilley7 commented Aug 15, 2025

Changed these properties to be non-fixed (made no-fixed by creating a thread pool in the run method of Manager that "refresh" these properties on an interval):

  • MANAGER_TABLET_REFRESH_MINTHREADS
  • MANAGER_TABLET_REFRESH_MAXTHREADS

Removed these non-fixed properties that were labeled as fixed:

  • MANAGER_MINTHREADS
  • SSERV_MINTHREADS
  • TSERV_MINTHREADS
  • COMPACTOR_MINTHREADS

All of the other properties in FIXED_PROPERTIES besides these need to be evaluated similarly in another PR.

Partial work for #5696

Changed these properties to be non-fixed (made no-fixed by creating a thread pool in the run method of Manager that "refresh" these properties on an interval):
* `MANAGER_TABLET_REFRESH_MINTHREADS`
* `MANAGER_TABLET_REFRESH_MAXTHREADS`
Removed these non-fixed properties that were labeled as fixed:
* `MANAGER_MINTHREADS`
* `SSERV_MINTHREADS`
* 'TSERV_MINTHREADS'
* `COMPACTOR_MINTHREADS`
All of the other properties in FIXED_PROPERTIES besides these need to be evaluated similarly.

Partial work for apache#5696
@dlmarion
Copy link
Contributor

Please take a look at ThreadPools.resizePool. We have some logic there that you can call from the refresh thread in the Manager. I'm not sure if fully covers what you are trying to here, but I know it partially does. Also, please use the Logger object instead of printing to System.out / System.err. We only do that in certain circumstances, like in utility code.

@ibilley7
Copy link
Contributor Author

So would you recommend using the resizePool method, or just more so modeling the code based off of it?

@dlmarion
Copy link
Contributor

So would you recommend using the resizePool method, or just more so modeling the code based off of it?

I would recommend reusing it if you can. If there is something that you need that it's not currently doing, then lets fix it or add a new resizePool method in ThreadPools.

@ibilley7
Copy link
Contributor Author

ibilley7 commented Aug 19, 2025

I noticed that the resizePool() method resizes based on the maxThread property, and that when it's changed, the minThreads property is also changed to that new size in this code:

if (newCount > count) {
      // increasing, increase the max first, or the core will fail to be increased
      pool.setMaximumPoolSize(newCount);
      pool.setCorePoolSize(newCount);
    } else {
      // decreasing, lower the core size first, or the max will fail to be lowered
      pool.setCorePoolSize(newCount);
      pool.setMaximumPoolSize(newCount);
    }

Does that mean in the new resizePool() method I create for minThreads that when the CorePoolSize is changed, it would set the MaximumPoolSize to the same new value? I'm just a little confused on the relationship between the MaximumPoolSize and the CorePoolSize.

@dlmarion
Copy link
Contributor

I noticed that the resizePool() method resizes based on the maxThread property, and that when it's changed, the minThreads property is also changed to that new size in this code:

Right, this was the logic that I was mentioning. IIRC we had to modify the core/max in a specific order based on the JDK internal code at that time. The current code just resizes based on the max size property IIRC because I don't think we resize based on the min/core size. You are trying to do something a little different than what we have done in the past, so you likely need a new method to resize the core and max independently, but might need to retain some of the logic from the existing resizePool method.

@kevinrr888 kevinrr888 added this to the 4.0.0 milestone Aug 21, 2025
@ibilley7
Copy link
Contributor Author

My internship is over, so I would need someone to pick up this ticket if more work needs to be done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants