Fail fast if the prepared id doesn't match when we reprepare on the fly

Description

There are cases where the driver might go into an infinite reprepare loop if a statement gets prepared, the session is switched to a different keyspace, the statement gets invalidated from the server cache, and the driver tries to reprepare on the fly: see CASSANDRA-15252.

Environment

None

Pull Requests

None

Status

Assignee

Unassigned

Reporter

Jorge Bay Gondra

Reviewer

None

Fix versions

None

Labels

None

Components

None

PM Priority

None

Reproduced in

None

External issue ID

None

External issue ID

None

External issue ID

None

External issue ID

None

External issue ID

None

External issue ID

None

Doc Impact

None

Size

None

Priority

Major
Configure