Data streams make "unavailable_shards_exception"

Describe the issue:
When ingesting logs with fluentbit I’m sometimes getting the following errors

[{“create”:{“_index”:“.ds-nginx-production-ds-000050”,“_id”:“E04dnocBjfEx0vgMj32g”,“status”:503,“error”:{“type”:“unavailable_shards_exception”,“reason”:“[.ds-nginx-production-ds-000050][0] primary shard is not active Timeout: [1m], request: [BulkShardRequest [[.ds-nginx-production-ds-000050][0]] containing [3345] requests]”}}}

I guess it happens when the datastream is closing the index.
But what cannot do to go around this problem?

As I know, data stream does not close its backing indices, there maybe some other issues in your cluster.