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

bugfix: server restart not recover max sessionId on db mode #1850

Merged
merged 7 commits into from
Nov 8, 2019
Merged

bugfix: server restart not recover max sessionId on db mode #1850

merged 7 commits into from
Nov 8, 2019

Conversation

slievrly
Copy link
Member

@slievrly slievrly commented Oct 30, 2019

Signed-off-by: slievrly slievrly@163.com

Ⅰ. Describe what this PR did

bugfix: server restart not recover max sessionId on db mode

Ⅱ. Does this pull request fix one issue?

fix #1851

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

image

Ⅴ. Special notes for reviews

Signed-off-by: slievrly <slievrly@163.com>
Signed-off-by: slievrly <slievrly@163.com>
@codecov-io
Copy link

codecov-io commented Oct 31, 2019

Codecov Report

Merging #1850 into develop will decrease coverage by 0.18%.
The diff coverage is 14.28%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #1850      +/-   ##
=============================================
- Coverage      55.34%   55.16%   -0.19%     
- Complexity      2376     2377       +1     
=============================================
  Files            422      422              
  Lines          14333    14392      +59     
  Branches        1719     1729      +10     
=============================================
+ Hits            7933     7939       +6     
- Misses          5656     5708      +52     
- Partials         744      745       +1
Impacted Files Coverage Δ Complexity Δ
...o/seata/core/constants/ServerTableColumnsName.java 0% <ø> (ø) 0 <0> (ø) ⬇️
...io/seata/server/store/TransactionStoreManager.java 86.66% <ø> (ø) 0 <0> (ø) ⬇️
...rver/store/db/DatabaseTransactionStoreManager.java 66.16% <0%> (-0.51%) 22 <0> (ø)
...server/store/file/FileTransactionStoreManager.java 56.96% <0%> (-0.19%) 29 <0> (ø)
...main/java/io/seata/core/store/db/LogStoreSqls.java 19.6% <0%> (-0.81%) 10 <0> (ø)
...eata/server/session/db/DataBaseSessionManager.java 33.87% <0%> (-2.34%) 12 <0> (ø)
...va/io/seata/core/store/db/LogStoreDataBaseDAO.java 54.47% <12.82%> (-5.01%) 21 <0> (ø)
...r/src/main/java/io/seata/server/UUIDGenerator.java 63.33% <60%> (+1.79%) 5 <1> (+1) ⬆️
...io/seata/server/session/DefaultSessionManager.java 65.62% <9.09%> (-29.83%) 9 <1> (ø)

@zjinlei zjinlei added this to the 1.0 milestone Nov 2, 2019
Signed-off-by: slievrly <slievrly@163.com>
Copy link
Member

@xingfudeshi xingfudeshi left a comment

Choose a reason for hiding this comment

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

LGTM

public void reload() {
long maxSessionId = transactionStoreManager.getCurrentMaxSessionId();
if (maxSessionId > UUIDGenerator.getCurrentUUID()) {
UUIDGenerator.setUUID(UUIDGenerator.getCurrentUUID(), maxSessionId + 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

no need to add 1

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

Signed-off-by: slievrly <slievrly@163.com>
Signed-off-by: slievrly <slievrly@163.com>
Copy link
Contributor

@zjinlei zjinlei left a comment

Choose a reason for hiding this comment

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

LGTM

@zjinlei zjinlei merged commit a5db2aa into apache:develop Nov 8, 2019
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.

server restart not recover max sessionId on db mode
4 participants