You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/12/15 07:50:22 UTC
[GitHub] [shardingsphere] XZX369 opened a new issue, #22884: 时间分片生成的表不符合配置逻辑
XZX369 opened a new issue, #22884:
URL: https://github.com/apache/shardingsphere/issues/22884
```
chemaName: iot_plat_db
dataSources:
write_ds:
url: jdbc:mysql://192.168.1.100:3306/testt?serverTimezone=UTC&useSSL=false
username: root
password: 123456
connectionTimeoutMilliseconds: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1
read_ds_0:
url: jdbc:mysql://192.168.1.101:3306/test?serverTimezone=UTC&useSSL=false
username: root
password: 123456
connectionTimeoutMilliseconds: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1
rules:
#读写分离
- !READWRITE_SPLITTING
dataSources:
readwrite_ds:
staticStrategy:
writeDataSourceName: write_ds
readDataSourceNames:
- read_ds_0
loadBalancerName: random
loadBalancers:
random:
type: RANDOM
#水平分片
- !SHARDING
tables:
test_log:
actualDataNodes: readwrite_ds.test_log_$->{202206..202406}
tableStrategy:
standard:
shardingColumn: CREATE_TIME
shardingAlgorithmName: test_interval
task:
actualDataNodes: readwrite_ds.task_$->{2022-06..2024-06}
tableStrategy:
standard:
shardingColumn: CREATE_TIME
shardingAlgorithmName: task_interval
#分片算法
shardingAlgorithms:
test_interval:
type: COSID_INTERVAL_SNOWFLAKE
props:
zone-id: "Asia/Shanghai"
logic-name-prefix: "test"
datetime-pattern: "yyyy-MM-dd HH:mm:ss" # 分片字段格式
datetime-lower: "2022-06-01 00:00:00" # 范围下限
datetime-upper: "2024-06-30 23:59:59" # 范围上限
sharding-suffix-pattern: "yyyy-MM" # 分片名后缀,可以是MM,yyyyMMdd等。
datetime-interval-amount: 6 # 分片间隔,这里指一个月
datetime-interval-unit: "MONTHS" # 分片间隔单位
task_interval:
type: INTERVAL
props:
datetime-pattern: "yyyy-MM" # 分片字段格式
datetime-lower: "2022-06" # 范围下限
datetime-upper: "2024-06" # 范围上限
sharding-suffix-pattern: "yyyy-MM" # 分片名后缀,可以是MM,yyyyMMdd等。
datetime-interval-amount: 1 # 分片间隔,这里指一个月
datetime-interval-unit: "MONTHS" # 分片间隔单位
```
test_log 生成的分片表后缀为: 202206,202207,,,202299,,,202399,,,202406
task 生成的分片表后缀为:2016,2017,2018
--
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: notifications-unsubscribe@shardingsphere.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] linghengqian commented on issue #22884: The table generated by time fragments does not conform to the configuration logic
Posted by GitBox <gi...@apache.org>.
linghengqian commented on issue #22884:
URL: https://github.com/apache/shardingsphere/issues/22884#issuecomment-1353420935
- You can verify the final result of your actualDataNodes in `org.apache.shardingsphere.infra.util.expr.InlineExpressionheParser` and `org.apache.shardingsphere.infra.util.expr.InlineExpressionParserTest`, which is actually reasonable. Your target list needs a groovy expression that limits the month.
- Since there is an extension topic in this, I opened https://github.com/apache/shardingsphere/issues/22899
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] XZX369 commented on issue #22884: The table generated by time fragments does not conform to the configuration logic
Posted by GitBox <gi...@apache.org>.
XZX369 commented on issue #22884:
URL: https://github.com/apache/shardingsphere/issues/22884#issuecomment-1374344524
shardingsphere 5.1.2, database connection pool maxPoolSize: 500 minPoolSize: 50, but sharding often freezes, resulting in connection anomalies. This is a big risk for online use, and what configurations can be optimized to handle a large number of connections without failing unexpectedly
shardingsphere 5.1.2, 数据库连接池 maxPoolSize: 500 minPoolSize: 50, 但是sharding还是会经常卡死,导致连接异常.这样对于线上使用有很大的风险,有哪些配置可以优化到能处理大量连接不会异常挂掉呢
走路太骚扭到小腰?
***@***.***
------------------ 原始邮件 ------------------
发件人: "apache/shardingsphere" ***@***.***>;
发送时间: 2022年12月16日(星期五) 下午5:12
***@***.***>;
***@***.******@***.***>;
主题: Re: [apache/shardingsphere] The table generated by time fragments does not conform to the configuration logic (Issue #22884)
@XZX369
Simply put, you need to replace readwrite_ds.test_log_$->{202206..202406} with readwrite_ds.test_log$->2023$->{01..12}, readwrite_ds.test_log$->{[2022 , 2024]}1$->{06..12}.
If you're dynamically changing this value via something like DistSQL, you should tend to use readwrite_ds.test_log$->{[202206,202207,202208,202209,202210,202211,202212,202301,202302]}, something like this It is more convenient to generate a more readable string expression.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] linghengqian commented on issue #22884: The table generated by time fragments does not conform to the configuration logic
Posted by GitBox <gi...@apache.org>.
linghengqian commented on issue #22884:
URL: https://github.com/apache/shardingsphere/issues/22884#issuecomment-1354426118
@XZX369
- Simply put, you need to replace `readwrite_ds.test_log_$->{202206..202406}` with `readwrite_ds.test_log$->2023$->{01..12}, readwrite_ds.test_log$->{[2022 , 2024]}1$->{06..12}`.
- If you're dynamically changing this value via something like DistSQL, you should tend to use `readwrite_ds.test_log$->{[202206,202207,202208,202209,202210,202211,202212,202301,202302]}`, something like this It is more convenient to generate a more readable string expression.
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] linghengqian closed issue #22884: The table generated by time fragments does not conform to the configuration logic
Posted by "linghengqian (via GitHub)" <gi...@apache.org>.
linghengqian closed issue #22884: The table generated by time fragments does not conform to the configuration logic
URL: https://github.com/apache/shardingsphere/issues/22884
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] linghengqian commented on issue #22884: The table generated by time fragments does not conform to the configuration logic
Posted by GitBox <gi...@apache.org>.
linghengqian commented on issue #22884:
URL: https://github.com/apache/shardingsphere/issues/22884#issuecomment-1374512666
@XZX369
- I'm not sure about the relationship between `走路太骚扭到小腰` and `sharding often freezes`, I assume you can open a new issue and provide a minimal reproducible example.
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] azexcy commented on issue #22884: The table generated by time fragments does not conform to the configuration logic
Posted by GitBox <gi...@apache.org>.
azexcy commented on issue #22884:
URL: https://github.com/apache/shardingsphere/issues/22884#issuecomment-1353147823
Hi @XZX369 thanks for feedback, please provide the version used, try to follow the issue template so that we can get more valid information
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] XZX369 commented on issue #22884: The table generated by time fragments does not conform to the configuration logic
Posted by GitBox <gi...@apache.org>.
XZX369 commented on issue #22884:
URL: https://github.com/apache/shardingsphere/issues/22884#issuecomment-1354059375
The version I use is sharding-proxy 5.2.1. I have read the question, but it is not easy to implement. How should I operate now to achieve the effect I wan。
------------------ 原始邮件 ------------------
发件人: "apache/shardingsphere" ***@***.***>;
发送时间: 2022年12月15日(星期四) 晚上10:06
***@***.***>;
***@***.******@***.***>;
主题: Re: [apache/shardingsphere] The table generated by time fragments does not conform to the configuration logic (Issue #22884)
Hi @XZX369 thanks for feedback, please provide the version used, try to follow the issue template so that we can get more valid information
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] linghengqian commented on issue #22884: The table generated by time fragments does not conform to the configuration logic
Posted by "linghengqian (via GitHub)" <gi...@apache.org>.
linghengqian commented on issue #22884:
URL: https://github.com/apache/shardingsphere/issues/22884#issuecomment-1738304000
- The new SPI was introduced in the related PR at https://github.com/apache/shardingsphere/issues/22899 , this issue can now define `List<String>` via an new Row Value Expression SPI implementation.
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org