Skip to content

IGNITE-22298 Fix node crash on empty cache group name - #13683

Merged
NSAmelchev merged 2 commits into
apache:masterfrom
rezataroosheh:IGNITE-22298
Oct 16, 2026
Merged

NSAmelchev merged 2 commits into
apache:masterfrom
rezataroosheh:IGNITE-22298

Conversation

@rezataroosheh

@rezataroosheh rezataroosheh commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

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:

  • When a cache is started dynamically (createCache from a server, a client node, a thin client, or SQL).
  • When a node starts with a static cache configuration; the check runs locally before the node joins the cluster.

null is still allowed and means the cache is not part of a group.

Why

An empty group name used to break the cluster:

  • A node starting with such a static cache configuration caused a critical failure (SYSTEM_WORKER_TERMINATION) on the healthy nodes that were already running. With the default failure handler, those nodes stop.
  • A dynamic createCache failed 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 to IgniteCacheTestSuite2) checks that a cache with an empty group name is rejected with a clear error in all three cases: a dynamic createCache on a server node, a thin-client createCache, and a node starting with such a static cache configuration. The test fails without the fix.

The Contribution Checklist

  • There is a single JIRA ticket related to the pull request.
  • The web-link to the pull request is attached to the JIRA ticket.
  • The JIRA ticket has the Patch Available state.
  • The pull request body describes changes that have been made.
    The description explains WHAT and WHY was made instead of HOW.
  • The pull request title is treated as the final commit message.
    The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
  • A reviewer has been mentioned through the JIRA comments
    (see the Maintainers list)
  • The pull request has been checked by the Teamcity Bot and
    the green visa attached to the JIRA ticket (see tab PR Check at 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.

@rezataroosheh
rezataroosheh marked this pull request as ready for review October 11, 2026 21:45
@NSAmelchev

Copy link
Copy Markdown
Contributor

LGTM overall. One suggestion: the test can be simplified — once the IllegalArgumentException with the expected message is asserted, the request never reached the exchange, so the failure handler and checkClusterOperational() add no coverage, and one server is enough. Sketch (fails without the fix, ~6 s):

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);
    }
}

@rezataroosheh

Copy link
Copy Markdown
Contributor Author

@NSAmelchev, thanks for the review! I simplified the test as you suggested.

@NSAmelchev
NSAmelchev merged commit dfa5511 into apache:master Oct 16, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants