sanpwc commented on code in PR #7136:
URL: https://github.com/apache/ignite-3/pull/7136#discussion_r2598823015
##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/TxMetaSerializer.java:
##########
@@ -66,60 +60,44 @@ protected void writeExternalData(TxMeta meta,
IgniteDataOutput out) throws IOExc
HybridTimestamp.write(meta.commitTimestamp(), out);
}
- private static boolean hasAnyZonePartitionIds(TxMeta meta) {
- return meta.enlistedPartitions().stream()
- .anyMatch(partition -> partition.groupId() instanceof
ZonePartitionId);
- }
-
- private static boolean hasNoTablePartitionIds(TxMeta meta) {
- return meta.enlistedPartitions().stream()
- .noneMatch(partition -> partition.groupId() instanceof
TablePartitionId);
- }
-
@Override
protected TxMeta readExternalData(byte protoVer, IgniteDataInput in)
throws IOException {
- boolean usesZonePartitionIds;
+ // V1 version is not supported anymore.
+ if (protoVer == 1) {
+ throw new IllegalArgumentException("Transaction meta v1 is not
supported.");
+ }
+
if (protoVer >= 2) {
- usesZonePartitionIds = in.readBoolean();
- } else {
- usesZonePartitionIds = false;
+ boolean usesZonePartitionIds = in.readBoolean();
+ assert usesZonePartitionIds : "Transaction meta relies on table
partition IDs.";
Review Comment:
Yep, perfect.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]