Skip to content

Commit 3c62d9a

Browse files
committed
Merge branch 'master' into pattern-prune
2 parents 4ac016a + 8cb4b9b commit 3c62d9a

File tree

83 files changed

+1328
-2539
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+1328
-2539
lines changed

dependencies.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@
3232
"com.nimbusds:nimbus-jose-jwt",
3333
"com.nimbusds:oauth2-oidc-sdk",
3434
"com.sun.istack:istack-commons-runtime",
35-
"com.timecho.ratis:ratis-client",
36-
"com.timecho.ratis:ratis-common",
37-
"com.timecho.ratis:ratis-grpc",
38-
"com.timecho.ratis:ratis-metrics-api",
39-
"com.timecho.ratis:ratis-proto",
40-
"com.timecho.ratis:ratis-server",
41-
"com.timecho.ratis:ratis-server-api",
35+
"org.apache.ratis:ratis-client",
36+
"org.apache.ratis:ratis-common",
37+
"org.apache.ratis:ratis-grpc",
38+
"org.apache.ratis:ratis-metrics-api",
39+
"org.apache.ratis:ratis-proto",
40+
"org.apache.ratis:ratis-server",
41+
"org.apache.ratis:ratis-server-api",
4242
"com.zaxxer:HikariCP",
4343
"commons-cli:commons-cli",
4444
"commons-codec:commons-codec",

integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBAuthIT.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
import static org.apache.iotdb.commons.auth.entity.User.INTERNAL_USER_END_ID;
5555
import static org.apache.iotdb.db.audit.DNAuditLogger.PREFIX_PASSWORD_HISTORY;
5656
import static org.apache.iotdb.db.it.utils.TestUtils.createUser;
57+
import static org.apache.iotdb.db.it.utils.TestUtils.executeNonQuery;
5758
import static org.apache.iotdb.db.it.utils.TestUtils.resultSetEqualTest;
5859
import static org.junit.Assert.assertEquals;
5960
import static org.junit.Assert.assertFalse;
@@ -1381,6 +1382,7 @@ public void noNeedPrivilegeTest() {
13811382
"tempuser,",
13821383
};
13831384
resultSetEqualTest("show current_user", expectedHeader, retArray, "tempuser", "temppw123456");
1385+
executeNonQuery("SHOW AVAILABLE URLS", "tempuser", "temppw123456");
13841386
}
13851387

13861388
@Ignore

integration-test/src/test/java/org/apache/iotdb/relational/it/db/it/IoTDBDeletionTableIT.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1741,7 +1741,11 @@ private List<TimeRange> collectDataRanges(Statement statement, long timeUpperBou
17411741
List<TimeRange> ranges = new ArrayList<>();
17421742
try (ResultSet set =
17431743
statement.executeQuery(
1744-
"select time from table" + testNum + " where time <= " + timeUpperBound)) {
1744+
"select time from table"
1745+
+ testNum
1746+
+ " where time <= "
1747+
+ timeUpperBound
1748+
+ " order by time")) {
17451749
while (set.next()) {
17461750
long time = set.getLong(1);
17471751
if (ranges.isEmpty()) {

integration-test/src/test/java/org/apache/iotdb/relational/it/schema/IoTDBTableIT.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,22 @@ public void testManageTable() {
150150
assertEquals(tableNames.length, cnt);
151151
}
152152

153+
// Test unsupported, to be deleted
154+
try {
155+
statement.execute("alter table test1.table1 rename to tableN");
156+
} catch (final SQLException e) {
157+
assertEquals("701: The renaming for base table is currently unsupported", e.getMessage());
158+
}
159+
160+
// Test unsupported, to be deleted
161+
try {
162+
statement.execute(
163+
"alter table if exists test_db.table1 rename column if exists model to modelType");
164+
} catch (final SQLException e) {
165+
assertEquals(
166+
"701: The renaming for base table column is currently unsupported", e.getMessage());
167+
}
168+
153169
// Alter table properties
154170
statement.execute("alter table test1.table1 set properties ttl=1000000");
155171
ttls = new String[] {"1000000"};

iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TElasticFramedTransport.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
import java.io.EOFException;
3333
import java.net.SocketAddress;
34+
import java.net.SocketException;
3435
import java.net.SocketTimeoutException;
3536

3637
// https://github.com/apache/thrift/blob/master/doc/specs/thrift-rpc.md
@@ -125,6 +126,10 @@ public int read(byte[] buf, int off, int len) throws TTransportException {
125126
// Read another frame of data
126127
readFrame();
127128
} catch (TTransportException e) {
129+
// Adding this workaround to avoid the Connection reset error log printed.
130+
if (e.getCause() instanceof SocketException && e.getMessage().contains("Connection reset")) {
131+
throw new TTransportException(TTransportException.END_OF_FILE, e.getCause());
132+
}
128133
// There is a bug fixed in Thrift 0.15. Some unnecessary error logs may be printed.
129134
// See https://issues.apache.org/jira/browse/THRIFT-5411 and
130135
// https://github.com/apache/thrift/commit/be20ad7e08fab200391e3eab41acde9da2a4fd07

iotdb-client/session/src/main/java/org/apache/iotdb/session/NodesSupplier.java

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,12 @@ public class NodesSupplier implements INodeSupplier, Runnable {
4040
private static final Logger LOGGER = LoggerFactory.getLogger(NodesSupplier.class);
4141

4242
private static final long UPDATE_PERIOD_IN_S = 60;
43-
private static final String SHOW_DATA_NODES_COMMAND = "SHOW DATANODES";
44-
45-
private static final String STATUS_COLUMN_NAME = "Status";
43+
private static final String SHOW_AVAILABLE_URLS_COMMAND = "SHOW AVAILABLE URLS";
4644

4745
private static final String IP_COLUMN_NAME = "RpcAddress";
4846

4947
private static final String PORT_COLUMN_NAME = "RpcPort";
5048

51-
private static final String REMOVING_STATUS = "Removing";
52-
5349
// it's ok that TIMEOUT_IN_MS is larger than UPDATE_PERIOD_IN_S, because the next update request
5450
// won't be scheduled until last time is done.
5551
private static final long TIMEOUT_IN_MS = 60_000;
@@ -228,28 +224,31 @@ public Optional<TEndPoint> getQueryEndPoint() {
228224

229225
private boolean updateDataNodeList() {
230226
try (SessionDataSet sessionDataSet =
231-
client.executeQueryStatement(SHOW_DATA_NODES_COMMAND, TIMEOUT_IN_MS, FETCH_SIZE)) {
232-
SessionDataSet.DataIterator iterator = sessionDataSet.iterator();
233-
List<TEndPoint> res = new ArrayList<>();
234-
while (iterator.next()) {
235-
String ip = iterator.getString(IP_COLUMN_NAME);
236-
// ignore 0.0.0.0 and removing DN
237-
if (!REMOVING_STATUS.equals(iterator.getString(STATUS_COLUMN_NAME))
238-
&& !"0.0.0.0".equals(ip)) {
239-
String port = iterator.getString(PORT_COLUMN_NAME);
240-
if (ip != null && port != null) {
241-
res.add(new TEndPoint(ip, Integer.parseInt(port)));
242-
}
243-
}
244-
}
245-
// replace the older ones.
246-
if (!res.isEmpty()) {
247-
availableNodes = res;
248-
}
249-
return true;
250-
} catch (Exception e) {
227+
client.executeQueryStatement(SHOW_AVAILABLE_URLS_COMMAND, TIMEOUT_IN_MS, FETCH_SIZE)) {
228+
updateAvailableNodes(sessionDataSet);
229+
} catch (Exception e1) {
251230
LOGGER.warn("Failed to fetch data node list from {}.", client.endPoint);
252231
return false;
253232
}
233+
return true;
234+
}
235+
236+
private void updateAvailableNodes(SessionDataSet sessionDataSet) throws Exception {
237+
SessionDataSet.DataIterator iterator = sessionDataSet.iterator();
238+
List<TEndPoint> res = new ArrayList<>();
239+
while (iterator.next()) {
240+
String ip = iterator.getString(IP_COLUMN_NAME);
241+
// ignore 0.0.0.0
242+
if (!"0.0.0.0".equals(ip)) {
243+
String port = iterator.getString(PORT_COLUMN_NAME);
244+
if (ip != null && port != null) {
245+
res.add(new TEndPoint(ip, Integer.parseInt(port)));
246+
}
247+
}
248+
}
249+
// replace the older ones.
250+
if (!res.isEmpty()) {
251+
availableNodes = res;
252+
}
254253
}
255254
}

iotdb-core/ainode/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
# generated by maven
1515
/iotdb/ainode/conf/
1616

17+
# generated by poetry
18+
poetry.lock
19+
1720
# generated by pyinstaller
1821
/dist/
1922
/build/

iotdb-core/ainode/build_binary.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,14 @@ def verify_poetry_env():
434434
verify_poetry_env() # Verify after lock
435435

436436
print("Running poetry install...")
437+
subprocess.run(
438+
[str(poetry_exe), "lock"],
439+
cwd=str(script_dir),
440+
env=venv_env,
441+
check=True,
442+
capture_output=True,
443+
text=True,
444+
)
437445
verify_poetry_env() # Verify before install
438446
result = subprocess.run(
439447
[str(poetry_exe), "install"],

0 commit comments

Comments
 (0)