[
https://issues.apache.org/jira/browse/IGNITE-26344?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18022074#comment-18022074
]
Mikhail Efremov commented on IGNITE-26344:
------------------------------------------
Mostly the solution requires to remove default zone creation and set default
commands while catalog initialization in {{CatalogManagerImpl#initCatalog}} and
add the corresponding commands during create table catalog command processing
on {{CreateTableCommand#get}}:
{code:java}
if (zoneName == null) {
if (catalog.defaultZone() == null) {
int zoneId = id++;
zone = new CatalogZoneDescriptor(
zoneId,
DEFAULT_ZONE_NAME,
DEFAULT_PARTITION_COUNT,
DEFAULT_REPLICA_COUNT,
DEFAULT_ZONE_QUORUM_SIZE,
defaultZoneDefaultAutoAdjustScaleUpTimeoutSeconds(colocationEnabled),
INFINITE_TIMER_VALUE,
DEFAULT_FILTER,
new CatalogStorageProfilesDescriptor(List.of(new
CatalogStorageProfileDescriptor(DEFAULT_STORAGE_PROFILE))),
STRONG_CONSISTENCY
);
createNewDefaultZone = true;
} else {
zone = catalog.defaultZone();
}
} else {
zone = zone(catalog, zoneName, true);
}
{code}
and add them to returning commands list if default zone should be created:
{code:java}
return createNewDefaultZone
? List.of(
new NewZoneEntry(zone),
new SetDefaultZoneEntry(zone.id()),
new NewTableEntry(table),
new NewIndexEntry(pkIndex),
new ObjectIdGenUpdateEntry(id -
catalog.objectIdGenState()))
: List.of(
new NewTableEntry(table),
new NewIndexEntry(pkIndex),
new ObjectIdGenUpdateEntry(id -
catalog.objectIdGenState()));
{code}
This is the main action points. All other issues are related to tests changes
for changed invariant that during catalog's init there is default zone.
> Design lazy default zone creation on table creation
> ----------------------------------------------------
>
> Key: IGNITE-26344
> URL: https://issues.apache.org/jira/browse/IGNITE-26344
> Project: Ignite
> Issue Type: Task
> Reporter: Mikhail Efremov
> Assignee: Mikhail Efremov
> Priority: Major
> Labels: ignite-3
> Time Spent: 10m
> Remaining Estimate: 0h
>
> *Description*
> The main goal of the ticket is to design and making POC of lazy default zone
> creation. Lazy means default zone is created if there was any create table
> action without zone specified.
> *Motivation*
> Default zone creation by default makes cluster struggle on start that affects
> on both UX and tests.
> *Definition of done*
> There is a patch that almost implementing or list of crucial issues that are
> blocking implementation.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)