SEZ9 commented on issue #9866:
URL: https://github.com/apache/seatunnel/issues/9866#issuecomment-5149901823
Could you share your (sanitized) source config and the output of
`db.getSiblingDB("config").collections.find({_id: "<db>.<collection>"})` run
against the config server? This will show whether the metadata entry for that
namespace actually contains a 'key' (shard key) field, or whether it is marked
`dropped: true` / missing (e.g. the collection is not sharded).
As a possible workaround, please check whether the target collection is
actually sharded. ShardedSplitStrategy is only valid for sharded collections;
if the collection is unsharded (or its metadata is stale, e.g. a leftover
`dropped: true` entry), the connector should fall back to another split
strategy instead of failing. You could also test with a user that does not have
read access to the `config` database to force the fallback path.
For maintainers: ShardedSplitStrategy.split (line 87) calls
getDocument("key") on the config.collections metadata without checking key
presence. We should add a defensive check (e.g. `containsKey("key")` and skip
`dropped: true` entries) and fall back to SplitVector/Sample strategies when
shard-key metadata is unavailable, rather than throwing
BsonInvalidOperationException.
<!-- streview-comment:30 -->
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]