This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch branch-1.2-lts
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-1.2-lts by this push:
new 44a54419c2 [fix](bdbje) fix handle bdb RollbackException incorrectly
(#17476)
44a54419c2 is described below
commit 44a54419c220e9fb15636c3a07d0d9e0894e253c
Author: Lei Zhang <[email protected]>
AuthorDate: Tue Mar 7 15:32:03 2023 +0800
[fix](bdbje) fix handle bdb RollbackException incorrectly (#17476)
cherry-pick #17483
---
.../java/org/apache/doris/journal/bdbje/BDBEnvironment.java | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/journal/bdbje/BDBEnvironment.java
b/fe/fe-core/src/main/java/org/apache/doris/journal/bdbje/BDBEnvironment.java
index 279f34da25..74c4c1bab0 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/journal/bdbje/BDBEnvironment.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/journal/bdbje/BDBEnvironment.java
@@ -394,6 +394,7 @@ public class BDBEnvironment {
public void closeReplicatedEnvironment() {
if (replicatedEnvironment != null) {
try {
+ openedDatabases.clear();
// Finally, close the store and environment.
replicatedEnvironment.close();
} catch (DatabaseException exception) {
@@ -408,7 +409,15 @@ public class BDBEnvironment {
for (int i = 0; i < RETRY_TIME; i++) {
try {
// open the environment
- replicatedEnvironment = new ReplicatedEnvironment(envHome,
replicationConfig, environmentConfig);
+ replicatedEnvironment =
+ new ReplicatedEnvironment(envHome, replicationConfig,
environmentConfig);
+
+ // start state change listener
+ StateChangeListener listener = new BDBStateChangeListener();
+ replicatedEnvironment.setStateChangeListener(listener);
+
+ // open epochDB. the first parameter null means auto-commit
+ epochDB = replicatedEnvironment.openDatabase(null, "epochDB",
dbConfig);
break;
} catch (DatabaseException e) {
if (i < RETRY_TIME - 1) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]