ChinmaySKulkarni commented on a change in pull request #923:
URL: https://github.com/apache/phoenix/pull/923#discussion_r505888007
##########
File path:
phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
##########
@@ -1336,6 +1337,8 @@ private TableDescriptor ensureTableCreated(byte[]
physicalTableName, PTableType
PBoolean.INSTANCE.toObject(newDesc.build().getValue(MetaDataUtil.IS_LOCAL_INDEX_TABLE_PROP_BYTES))))
{
newDesc.setRegionSplitPolicyClassName(IndexRegionSplitPolicy.class.getName());
}
+ // disable split policy for SYSTEM.TASK
+ isSplitPolicyUpdatedForTaskTable(newDesc);
Review comment:
All table creations go through this method so instead of polluting this
with SYSTEM.TASK specific stuff, I think we should divide the problem into 2
parts:
1. Fresh clusters -> Change the DDL for SYSTEM.TASK
(CQSI.CREATE_TASK_METADATA) itself so this would work directly i.e. add
HTableDescriptor.SPLIT_POLICY + "='" + SystemTaskSplitPolicy.class.getName()
+ "',\n"
and introduce a new class `SystemTaskSplitPolicy` which is equivalent to
`DisabledRegionSplitPolicy` for now, but can be easily changed in the future if
required without unloading and reloading the coproc.
2. Upgrade path -> <=4.15 clusters would go through upgradeSystemTask() and
here we could load the correct split policy. That way, we don't need the change
inside ensureTableCreated() and it is much cleaner. One corner case here
(highly unlikely, but still possible) is if a cluster already has SYSTEM.TASK
split. In that case, we might want to throw an exception or maybe merge regions
of SYSTEM.TASK
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]