提交 68a0ed13 authored 作者: Thomas Mueller's avatar Thomas Mueller

With the MVStore option, when using multiple threads that concurrently create…

With the MVStore option, when using multiple threads that concurrently create indexes or tables, it was relatively easy to get a lock timeout on the "SYS" table.
上级 76c45fe4
...@@ -122,11 +122,13 @@ public class Analyze extends DefineCommand { ...@@ -122,11 +122,13 @@ public class Analyze extends DefineCommand {
// (which is the case if we are within a trigger) // (which is the case if we are within a trigger)
// then we can't update the statistics because // then we can't update the statistics because
// that would unlock all locked objects // that would unlock all locked objects
synchronized (db) {
db.updateMeta(sysSession, table); db.updateMeta(sysSession, table);
sysSession.commit(true); sysSession.commit(true);
} }
} }
} }
}
public void setTop(int top) { public void setTop(int top) {
this.sampleRows = top; this.sampleRows = top;
......
...@@ -104,9 +104,11 @@ public class AlterSequence extends SchemaCommand { ...@@ -104,9 +104,11 @@ public class AlterSequence extends SchemaCommand {
// would keep other transactions from using the sequence // would keep other transactions from using the sequence
Session sysSession = db.getSystemSession(); Session sysSession = db.getSystemSession();
synchronized (sysSession) { synchronized (sysSession) {
synchronized (db) {
db.updateMeta(sysSession, sequence); db.updateMeta(sysSession, sequence);
sysSession.commit(true); sysSession.commit(true);
} }
}
return 0; return 0;
} }
......
...@@ -107,8 +107,10 @@ public class Set extends Prepared { ...@@ -107,8 +107,10 @@ public class Set extends Prepared {
database.setCluster(value); database.setCluster(value);
// use the system session so that the current transaction // use the system session so that the current transaction
// (if any) is not committed // (if any) is not committed
synchronized (database) {
addOrUpdateSetting(database.getSystemSession(), name, value, 0); addOrUpdateSetting(database.getSystemSession(), name, value, 0);
database.getSystemSession().commit(true); database.getSystemSession().commit(true);
}
break; break;
} }
case SetTypes.COLLATION: { case SetTypes.COLLATION: {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论