Repository navigation
IGNITE-22298 Fix node crash on empty cache group name - #13683
Merged
Merged
Conversation
rezataroosheh
marked this pull request as ready for review
October 11, 2026 21:45
Contributor
|
LGTM overall. One suggestion: the test can be simplified — once the public class CacheGroupNameValidationTest extends GridCommonAbstractTest {
/** */
private static final String ERR_MSG = "Cache group name must not be empty.";
/** {@inheritDoc} */
@Override protected void afterTest() throws Exception {
stopAllGrids();
}
/** */
@Test
public void testCreateCache() throws Exception {
IgniteEx srv = startGrid(0);
assertThrowsAnyCause(log, () -> srv.createCache(new CacheConfiguration<>("cache1").setGroupName("")),
IllegalArgumentException.class, ERR_MSG);
}
/** */
@Test
public void testThinClientCreateCache() throws Exception {
startGrid(0);
try (IgniteClient cli = Ignition.startClient(new ClientConfiguration().setAddresses("127.0.0.1:10800"))) {
Throwable e = assertThrowsWithCause(
() -> cli.createCache(new ClientCacheConfiguration().setName("cache1").setGroupName("")),
ClientException.class);
assertTrue(e.getMessage(), e.getMessage().contains(ERR_MSG));
}
}
/** */
@Test
public void testStaticConfiguration() throws Exception {
startGrid(0);
assertThrowsAnyCause(log, () -> startGrid(getConfiguration(getTestIgniteInstanceName(1))
.setCacheConfiguration(new CacheConfiguration<>("cache1").setGroupName(""))),
IllegalArgumentException.class, ERR_MSG);
}
} |
Contributor
Author
|
@NSAmelchev, thanks for the review! I simplified the test as you suggested. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A cache configuration with an empty cache group name (
setGroupName("")) is now rejected early with a clear error:Cache group name must not be empty.The check is done in two places:createCachefrom a server, a client node, a thin client, or SQL).nullis still allowed and means the cache is not part of a group.Why
An empty group name used to break the cluster:
SYSTEM_WORKER_TERMINATION) on the healthy nodes that were already running. With the default failure handler, those nodes stop.createCachefailed with a confusing "Failed to complete exchange process" error instead of a clear validation message.Now invalid configuration fails on the node that sent it, and the rest of the cluster is unaffected.
Tests
New
CacheGroupNameValidationTest(added toIgniteCacheTestSuite2) checks that a cache with an empty group name is rejected with a clear error in all three cases: a dynamiccreateCacheon a server node, a thin-clientcreateCache, and a node starting with such a static cache configuration. The test fails without the fix.The Contribution Checklist
The description explains WHAT and WHY was made instead of HOW.
The following pattern must be used:
IGNITE-XXXX Change summarywhereXXXX- number of JIRA issue.(see the Maintainers list)
the
green visaattached to the JIRA ticket (see tabPR Checkat TC.Bot - Instance 1 or TC.Bot - Instance 2)Notes
If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com #ignite channel.