Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GOBBLIN-1737] Fix bug when using mysql user quota manager #3595

Merged
merged 4 commits into from
Nov 8, 2022

Conversation

ZihanLi58
Copy link
Contributor

Dear Gobblin maintainers,

Please accept this PR. I understand that it will not be reviewed until I have checked off all the steps below!

JIRA

Description

  • Here are some details about my PR, including screenshots (if applicable):
    Change the way we get config to to consistent with other mysql store
    Only check quota in compiler when the flow compile successful and explain flag is not set
    Change the way we initialize the quota Manager.

Tests

  • My PR adds the following unit tests OR does not need testing for this extremely good reason:
    Deploy locally and verify the mysql quota manager works as expected

Commits

  • My commits all reference JIRA issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "How to write a good git commit message":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

@codecov-commenter
Copy link

codecov-commenter commented Oct 31, 2022

Codecov Report

Attention: Patch coverage is 50.00000% with 7 lines in your changes missing coverage. Please review.

Project coverage is 46.89%. Comparing base (4d991a9) to head (9e7c65a).
Report is 412 commits behind head on master.

Files with missing lines Patch % Lines
...ervice/modules/flow/BaseFlowToJobSpecCompiler.java 16.66% 3 Missing and 2 partials ⚠️
...e/modules/orchestration/MysqlUserQuotaManager.java 66.66% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3595      +/-   ##
============================================
+ Coverage     46.88%   46.89%   +0.01%     
- Complexity    10672    10676       +4     
============================================
  Files          2120     2120              
  Lines         83064    83075      +11     
  Branches       9250     9254       +4     
============================================
+ Hits          38942    38961      +19     
+ Misses        40554    40545       -9     
- Partials       3568     3569       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@umustafi umustafi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall. left some question for verification

@@ -295,7 +302,8 @@ public MysqlQuotaStore(BasicDataSource dataSource, String tableName)
DECREASE_FLOWGROUP_COUNT_SQL = "UPDATE " + tableName + " SET flowgroup_count=flowgroup_count-1 WHERE name = ?";
DELETE_USER_SQL = "DELETE FROM " + tableName + " WHERE name = ? AND user_count<1 AND flowgroup_count<1";

String createQuotaTable = "CREATE TABLE IF NOT EXISTS " + tableName + " (name VARCHAR(20) CHARACTER SET latin1 NOT NULL, "
//Increase the length of name as we include the executor uri in it
String createQuotaTable = "CREATE TABLE IF NOT EXISTS " + tableName + " (name VARCHAR(500) CHARACTER SET latin1 NOT NULL, "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

anything else contained in table name? how long is executor uri max? It will be helpful to give idea of what table name will be

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Under name, it will be "user name for the quota" + "spec uri". I tried 200 and see it does not work so directly give 500

@@ -390,7 +390,8 @@ public synchronized void setActive(boolean active) {

this.dagManagerMetrics.activate();

UserQuotaManager quotaManager = new InMemoryUserQuotaManager(config);
UserQuotaManager quotaManager = GobblinConstructorUtils.invokeConstructor(UserQuotaManager.class,
ConfigUtils.getString(config, ServiceConfigKeys.QUOTA_MANAGER_CLASS, ServiceConfigKeys.DEFAULT_QUOTA_MANAGER), config);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you see other types of quota manager besides in memory actually being used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In warm standby mode, we need use mysql based quota manager

@ZihanLi58 ZihanLi58 merged commit c3d1ba8 into apache:master Nov 8, 2022
phet pushed a commit to phet/gobblin that referenced this pull request Dec 3, 2022
* address comments

* use connectionmanager when httpclient is not cloesable

* [GOBBLIN-1737] Fix bug when using mysql user quota manager

* fix tests

Co-authored-by: Zihan Li <[email protected]>
phet added a commit to phet/gobblin that referenced this pull request Dec 5, 2022
* upstream/master:
  [GOBBLIN-1747] add job.name and job.id to kafka and compaction workunits (apache#3607)
  [GOBBLIN-1746] Add fs.uri to FsDatasetDescriptor to support copy between volumes in GaaS (apache#3605)
  [GOBBLIN-1743] Ensure GobblinTaskRunner works without Yarn use (apache#3602)
  [GOBBLIN-1745] Fix bug in SimpleKafkaSpecProducer (apache#3604)
  [GOBBLIN-1739]Define Datanodes and Dataset Descriptor for Iceberg (apache#3596)
  do not close DestinationDatasetHandlerService prematurely (apache#3601)
  [GOBBLIN-1720]Add ancestors owner permissions preservations for iceberg distcp (apache#3577)
  [HOTFIX] Fix checkstyleMain (apache#3600)
  [GOBBLIN-1736] Add metrics for change stream monitor and mysql quota manager (apache#3593)
  [GOBBLIN-1737] Fix bug when using mysql user quota manager (apache#3595)
  Correct a log line and GTE with currect number of total task count (apache#3591)
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