Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(store) add nil processing in lt function #367

Merged

Conversation

illia-li
Copy link
Contributor

Currently 'nil' come results panic:

{"L":"INFO","T":"2023-06-21T10:55:08.476-0400","N":"work cycle.validation_job","M":"Retring failed validation. 1 attempt from 10 attempts. Error: row count differ (test has 59 rows, oracle has 60 rows, test is missing rows: [pk16=45604486-11-25 23:27:42.51 +0000 UTC, \tpk17=3h50m24.065357675s, \tpk18=2130-04-03 00:00:00 +0000 UTC, \tpk19=52d8145cd62ff63, \tck=1829966953], oracle is missing rows: [])"}
{"L":"INFO","T":"2023-06-21T10:55:09.348-0400","N":"work cycle.validation_job","M":"ending validation loop"}
panic: unhandled type <nil>

@illia-li illia-li marked this pull request as ready for review June 21, 2023 17:41
@@ -75,6 +75,8 @@ func lt(mi, mj map[string]interface{}) bool {
case *big.Int:
mjs, _ := mj["pk0"].(*big.Int)
return mis.Cmp(mjs) < 0
case nil:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it does not work, it is type casting, while nil is value

Copy link
Contributor Author

@illia-li illia-li Jun 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nil - not value, nil- predictable identifier. This work or not work only experience shows, try this:

func main() {
	fmt.Println(nilDetecting(nil))
}

func nilDetecting(in interface{}) bool {
	switch in.(type) {
	case nil:
		return true
	default:
		return false
	}
}

output: true

@dkropachev dkropachev merged commit f802c33 into scylladb:master Jun 22, 2023
@illia-li illia-li deleted the il/fix-store_lt-add_nil_processing branch June 22, 2023 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants