-
Notifications
You must be signed in to change notification settings - Fork 961
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
[IOTDB-68] New shared-nothing cluster #460
Conversation
RaftMember.java How about:
|
PartitionGroup extends ArrayList is a little heavy.. |
SonarCloud Quality Gate failed. 28 Bugs No Coverage information |
fix some regression bugs
[IOTDB-884] group createMultiTimeseriesPlan by partitionGroup
fix takeSnapshot bug
# Conflicts: # docs/UserGuide/Server/Cluster Setup.md # docs/UserGuide/System Tools/NodeTool.md # docs/zh/UserGuide/Server/Cluster Setup.md # docs/zh/UserGuide/System Tools/NodeTool.md # server/src/main/java/org/apache/iotdb/db/engine/StorageEngine.java # server/src/main/java/org/apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java # server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileProcessor.java # server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileResource.java # server/src/main/java/org/apache/iotdb/db/metadata/MManager.java # server/src/main/java/org/apache/iotdb/db/metadata/MTree.java # server/src/main/java/org/apache/iotdb/db/metadata/PartialPath.java # server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java # server/src/main/java/org/apache/iotdb/db/qp/physical/PhysicalPlan.java # server/src/main/java/org/apache/iotdb/db/qp/physical/crud/InsertPlan.java # server/src/main/java/org/apache/iotdb/db/qp/physical/crud/InsertRowPlan.java # server/src/main/java/org/apache/iotdb/db/qp/physical/crud/InsertTabletPlan.java # server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java # server/src/main/java/org/apache/iotdb/db/utils/CommonUtils.java # server/src/main/java/org/apache/iotdb/db/utils/SchemaUtils.java # server/src/test/java/org/apache/iotdb/db/metadata/MManagerBasicTest.java # server/src/test/java/org/apache/iotdb/db/sync/receiver/load/FileLoaderTest.java # thrift/src/main/thrift/cluster.thrift
fix handling when client is null trigger election when leader is down
# Conflicts: # server/src/main/java/org/apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java
fix maybeTerm
The remaining code smells are duplicated code blocks caused by single inheritence in Java, and there are currently no elegant way to fix them. |
cluster/src/main/java/org/apache/iotdb/cluster/server/member/RaftMember.java
Outdated
Show resolved
Hide resolved
cluster/src/main/java/org/apache/iotdb/cluster/server/member/RaftMember.java
Outdated
Show resolved
Hide resolved
cluster/src/main/java/org/apache/iotdb/cluster/server/member/RaftMember.java
Outdated
Show resolved
Hide resolved
cluster/src/main/java/org/apache/iotdb/cluster/server/member/RaftMember.java
Outdated
Show resolved
Hide resolved
cluster/src/main/java/org/apache/iotdb/cluster/server/member/RaftMember.java
Outdated
Show resolved
Hide resolved
cluster/src/main/java/org/apache/iotdb/cluster/server/member/RaftMember.java
Outdated
Show resolved
Hide resolved
...er/src/main/java/org/apache/iotdb/cluster/server/handlers/caller/AppendNodeEntryHandler.java
Outdated
Show resolved
Hide resolved
...er/src/main/java/org/apache/iotdb/cluster/server/handlers/caller/AppendNodeEntryHandler.java
Outdated
Show resolved
Hide resolved
@@ -235,6 +235,8 @@ public void run() { | |||
ChunkWriterImpl chunkWriter = (ChunkWriterImpl) ioMessage; | |||
chunkWriter.writeToFileWriter(this.writer); | |||
} else { | |||
this.writer.setMinPlanIndex(memTable.getMinPlanIndex()); |
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.
why add min/max planIndex
on ChunkGroupFooter?
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.
It mainly used for a follower to catch up to the leader when doing snapshot task to filter tsfiles, for details please see https://issues.apache.org/jira/browse/IOTDB-918
@@ -162,7 +163,11 @@ public Statistics getStatistics() { | |||
|
|||
@Override | |||
public void setFilter(Filter filter) { | |||
this.filter = filter; | |||
if (this.filter == null) { |
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.
@JackieTien97 check whether this has some negative effect.
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.
Actually, i think we should just use the filter to overwrite the former one. The former one is actually a time filter and it has been checked when the PageReader is constructed.
And alse don't forget to change back the MemPageReader
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.
I previously found that data of this page will miss the previous filter, meaning some data are not time-filtered. We may remove it later if you are confident.
@@ -19,6 +19,11 @@ | |||
|
|||
--> | |||
|
|||
# 0.10.x (version-2) -> 0.12.x (version-3) | |||
| PR# | Name | Author | Changes | |
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.
need to say why on somewhere.
[Distributed] Make cluster configuration consensus with the single-node
* <p> | ||
* (1) return IoTDBJDBCResultSet or IoTDBNonAlignJDBCResultSet (2) simply get executed |
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.
format back
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 this way, the format will not be modified when the shortcut keys are used in the idea to automatically format, otherwise, the format will be modified if the shortcut keys are used.
@@ -52,7 +52,7 @@ | |||
<maxIndex>10</maxIndex> | |||
</rollingPolicy> | |||
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> | |||
<maxFileSize>1MB</maxFileSize> | |||
<maxFileSize>10MB</maxFileSize> |
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.
Why we need to change the default size of logs
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.
it's ok we use the server‘s logback's configuration as default configuration
fileProcessorMap.remove(timePartition); | ||
} | ||
} catch (Exception e) { | ||
logger.error("Cannot close {}", tsFileResource, e); |
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.
Should we rethrow the exception and add a finally block to do the remove things
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.
The exception will also only be logged in the upper level, so it is fine to do the logging here. When there is any exception, removing it may not be safe anymore, we'd better leave it be.
@@ -56,7 +56,7 @@ public NoCompactionTsFileManagement(String storageGroupName, String storageGroup | |||
if (sequence) { | |||
return new ArrayList<>(sequenceFileTreeSet); | |||
} else { | |||
return unSequenceFileList; | |||
return new ArrayList<>(unSequenceFileList); |
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.
No need to copy it again here, it won't be changed outside.
Actually it's better that the interface's return type should be changed to Collection
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.
But it may be changed indide, making an iteration throws a ConcurrentModificationException.
ReadWriteIOUtils.write(maxPlanIndex, outputStream); | ||
ReadWriteIOUtils.write(minPlanIndex, outputStream); |
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.
duplicated with the following lines
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.
Removed.
try { | ||
Files.deleteIfExists(file.toPath()); | ||
} catch (IOException e) { | ||
logger.warn("TsFile {} cannot be deleted: {}", file, e.getMessage()); |
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.
better to rethrow the exception
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.
This will break the code structure of many callers, and they can do nothing more than logging it.
Files.deleteIfExists( | ||
fsFactory.getFile(file.getPath() + ModificationFile.FILE_SUFFIX).toPath()); | ||
} catch (IOException e) { | ||
logger.warn("ModificationFile {} cannot be deleted: {}", file, e.getMessage()); |
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.
same as above
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.
See above.
try { | ||
Files.deleteIfExists(fsFactory.getFile(file.getPath() + RESOURCE_SUFFIX).toPath()); | ||
} catch (IOException e) { | ||
logger.warn("TsFileResource {} cannot be deleted: {}", file, e.getMessage()); |
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.
same as above
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.
See above.
private String measurementAlias = ""; | ||
// alias of time series used in SELECT AS | ||
private String tsAlias = null; | ||
private String tsAlias = ""; |
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.
How do we distinguish whether the measurement has an empty string as its alias or it doesn't have alias?
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.
@Alima777 PTAL(do you think it's a problem?)
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.
as far as I know, iotdb does not support empty string as an alias, so it's ok to use an empty string here.
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.
We do not support empty strings within timeseries paths, so there is even less meaning to support it in alias, so both make no difference.
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.
From my perspective, it's fine.
@@ -162,7 +163,11 @@ public Statistics getStatistics() { | |||
|
|||
@Override | |||
public void setFilter(Filter filter) { | |||
this.filter = filter; | |||
if (this.filter == null) { |
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.
Actually, i think we should just use the filter to overwrite the former one. The former one is actually a time filter and it has been checked when the PageReader is constructed.
And alse don't forget to change back the MemPageReader
} | ||
|
||
@Override | ||
public boolean isOpen() { return true; } |
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.
how about set to false
once close()
is called.
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.
No point. close()
means nothing to such classes. You may find similar codes in other thrift Transports like MemTransport.
server/src/test/java/org/apache/iotdb/db/writelog/recover/SeqTsFileRecoverTest.java
Show resolved
Hide resolved
server/src/main/java/org/apache/iotdb/db/tools/TsFileResourcePrinter.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileProcessor.java
Show resolved
Hide resolved
server/src/main/java/org/apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java
Show resolved
Hide resolved
# Conflicts: # server/src/main/java/org/apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java
# Conflicts: # server/src/main/java/org/apache/iotdb/db/sync/sender/transfer/SyncClient.java
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information The version of Java (1.8.0_252) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 11. |
Though there are many works left to do for this issue, I have to say you have reached a good milestone. So, I will merge this PR tonight. |
Co-authored-by: HouliangQi <neuyilan@163.com> Co-authored-by: wangyanhong <1101967410@qq.com> Co-authored-by: chaow <runhuster@foxmail.com> Co-authored-by: Jiang Tian <jt2594838@163.com> Co-authored-by: chaow <xunmengzhuiyi@gmail.com> Co-authored-by: LebronAl <TXYPotato@gmail.com> Co-authored-by: Ring-k <yuyuankang@hotmail.com> Co-authored-by: xiangdong huang <sainthxd@gmail.com>
No description provided.