Revisit keyspace change warning

Description

There has been some debate over whether this should be logged at WARN level.

At the very least, we can improve the message: it should explicitly mention session.execute("USE <ks>") (setting the keyspace at init time is not an issue), and explain the problem better, namely: the keyspace change will affect all requests on this session instance.

About the level, I still see some value in WARN, because in my opinion session.execute("USE...") is never the right thing to do in any serious application, and if someone does it it's most likely a misunderstanding of how the driver works. Also the message can be disabled via warn-if-set-keyspace in the configuration if you really know what you're doing. Other options include:

  1. log at INFO or DEBUG

  2. still log at WARN, but default the config option to false

  3. do nothing. When other requests expecting the old keyspace blow up in the user's face, they should eventually figure things out.

Environment

None

Pull Requests

None

Status

Assignee

Unassigned

Reporter

Olivier Michallat

Labels

None

PM Priority

None

Reproduced in

None

Affects versions

None

Fix versions

Pull Request

None

Doc Impact

None

Size

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

Priority

Minor
Configure