You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by "greatsharp (via GitHub)" <gi...@apache.org> on 2024/11/01 02:11:37 UTC

[I] StallConditionType2String transfer rocksdb::WriteStallCondition may be error [kvrocks]

greatsharp opened a new issue, #2633:
URL: https://github.com/apache/kvrocks/issues/2633

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/kvrocks/issues) and found no similar issues.
   
   
   ### Version
   
   kvrocks version 2.10.0
   
   ### Minimal reproduce step
   
   In rocksdb,  WriteStallCondition is declared below
   `enum class WriteStallCondition {
     kDelayed,
     kStopped,
     // Always add new WriteStallCondition before `kNormal`
     kNormal,
   };
   `
   see https://github.com/facebook/rocksdb/blob/main/include/rocksdb/types.h
   
   but in kvrocks  /src/storage/event_listener.cc, function define
   `std::string StallConditionType2String(const rocksdb::WriteStallCondition type) {
     std::vector<std::string> stall_condition_strings = {"normal", "delay", "stop"};
     if (static_cast<size_t>(type) < stall_condition_strings.size()) {
       return stall_condition_strings[static_cast<size_t>(type)];
     }
     return "unknown";
   }
   `
   
   if we pass type as WriteStallCondition::kNormal, then function StallConditionType2String returned 'stop';
   
   totally reversed.
   
   the EventListener::OnStallConditionsChanged will record a confused warning message.
   
   ### What did you expect to see?
   
   WriteStallCondition::kNormal should be transfer to normal,
   kDelayed should delay,
   kStopped should be stop
   
   ### What did you see instead?
   
   write stall condition was changed, from normal to stop
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!


-- 
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: issues-unsubscribe@kvrocks.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] StallConditionType2String transfer rocksdb::WriteStallCondition may be error [kvrocks]

Posted by "PragmaTwice (via GitHub)" <gi...@apache.org>.
PragmaTwice commented on issue #2633:
URL: https://github.com/apache/kvrocks/issues/2633#issuecomment-2451293915

   Good catch! Would you like to fix it?
   
   `std::vector<std::string>` seems not a good way to do that since it can not guarantee to be compatible to new versions of rocksdb when a new enum value is introduced.
   
   We can impl by a `std::map<SomeRocksdbEnumType, std::string>`.


-- 
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: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] StallConditionType2String transfer rocksdb::WriteStallCondition may be error [kvrocks]

Posted by "mapleFU (via GitHub)" <gi...@apache.org>.
mapleFU commented on issue #2633:
URL: https://github.com/apache/kvrocks/issues/2633#issuecomment-2451306843

   What about https://github.com/facebook/rocksdb/blob/a28cc4a38c2c7693a4786083d317bfc2cf874d76/db/write_stall_stats.h#L18 ?


-- 
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: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] StallConditionType2String transfer rocksdb::WriteStallCondition may be error [kvrocks]

Posted by "PragmaTwice (via GitHub)" <gi...@apache.org>.
PragmaTwice closed issue #2633: StallConditionType2String transfer rocksdb::WriteStallCondition may be error
URL: https://github.com/apache/kvrocks/issues/2633


-- 
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: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org