-
Notifications
You must be signed in to change notification settings - Fork 751
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,15 +50,22 @@ | |
@Slf4j | ||
@Singleton | ||
public class MysqlUserQuotaManager extends AbstractUserQuotaManager { | ||
public final static String CONFIG_PREFIX= "MysqlUserQuotaManager"; | ||
public final MysqlQuotaStore quotaStore; | ||
public final RunningDagIdsStore runningDagIds; | ||
|
||
|
||
@Inject | ||
public MysqlUserQuotaManager(Config config) throws IOException { | ||
super(config); | ||
this.quotaStore = createQuotaStore(config); | ||
this.runningDagIds = createRunningDagStore(config); | ||
Config quotaStoreConfig; | ||
if (config.hasPath(CONFIG_PREFIX)) { | ||
quotaStoreConfig = config.getConfig(CONFIG_PREFIX).withFallback(config); | ||
} else { | ||
throw new IOException("Please specify the config for MysqlUserQuotaManager"); | ||
} | ||
this.quotaStore = createQuotaStore(quotaStoreConfig); | ||
this.runningDagIds = createRunningDagStore(quotaStoreConfig); | ||
} | ||
|
||
void addDagId(Connection connection, String dagId) throws IOException { | ||
|
@@ -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, " | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
+ "user_count INT NOT NULL DEFAULT 0, requester_count INT NOT NULL DEFAULT 0, flowgroup_count INT NOT NULL DEFAULT 0, " | ||
+ "PRIMARY KEY (name), " + "UNIQUE INDEX ind (name))"; | ||
try (Connection connection = dataSource.getConnection(); PreparedStatement createStatement = connection.prepareStatement(createQuotaTable)) { | ||
|
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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